:root {
  --bg: #f7f2e7;
  --surface: #ffffff;
  --surface-2: #fffdf6;
  --surface-3: #edf3eb;
  --line: #dfd7bd;
  --text: #243b31;
  --muted: #6f7d75;
  --green: #4f715b;
  --green-dark: #365442;
  --lemon: #e7c84b;
  --lemon-soft: #f3e8a5;
  --amber: #d99722;
  --blue: #6aaee8;
  --coral: #ff8a70;
  --red: #e95f5f;
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 246, 194, 0.68) 0%, rgba(255, 250, 240, 0) 340px),
    var(--bg);
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  width: 100%;
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid rgba(234, 223, 189, 0.85);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #34522f;
  border: 1px solid rgba(255, 199, 41, 0.72);
  border-radius: 50% 45% 50% 45%;
  background:
    radial-gradient(circle at 32% 28%, #fff8b7 0 18%, transparent 19%),
    linear-gradient(145deg, #ffe66f, #ffc933);
  box-shadow: 0 12px 24px rgba(214, 164, 28, 0.2);
  font-weight: 900;
  font-size: 0;
  transform: rotate(-8deg);
  position: relative;
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4a3e21;
  box-shadow: 14px 0 #4a3e21, 7px 10px 0 -1px #ff9f70;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -4px;
  width: 14px;
  height: 9px;
  border-radius: 12px 2px 12px 2px;
  background: #56bd74;
  transform: rotate(23deg);
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p,
.section-head h3,
.section-head p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #667160;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-item::before {
  content: "";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: #687266;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 18px 18px;
}

.nav-item[data-icon="home"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 11.5 12 5l8 6.5V20a1 1 0 0 1-1 1h-5v-6h-4v6H5a1 1 0 0 1-1-1z' fill='black'/%3E%3C/svg%3E");
}

.nav-item[data-icon="book"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h6a3 3 0 0 1 3 3v13a3 3 0 0 0-3-3H5zM14 7a3 3 0 0 1 3-3h2v13h-2a3 3 0 0 0-3 3zM7 8h4v1.5H7zm0 4h4v1.5H7z' fill='black'/%3E%3C/svg%3E");
}

.nav-item[data-icon="calendar"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h2v3h6V3h2v3h2a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2zm-2 8v8h14v-8zm2 2h3v3H7z' fill='black'/%3E%3C/svg%3E");
}

.nav-item[data-icon="users"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 12a4 4 0 1 1 0-8 4 4 0 0 1 0 8m0 2c3.3 0 6 1.7 6 3.8V20H3v-2.2C3 15.7 5.7 14 9 14m7-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6m0 1c2.8 0 5 1.4 5 3.1V20h-4v-2.2c0-1.3-.7-2.5-1.9-3.4.3-.3.6-.4.9-.4' fill='black'/%3E%3C/svg%3E");
}

.nav-item[data-icon="report"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m3 12h2V9H8zm3 0h2V6h-2zm3 0h2v-5h-2z' fill='black'/%3E%3C/svg%3E");
}

.nav-item[data-icon="content"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v4H4zm0 6h10v4H4zm0 6h13v4H4z' fill='black'/%3E%3C/svg%3E");
}

.nav-link {
  text-decoration: none;
}

.nav-item[data-icon="settings"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 2 2 2.3 3-.5 1.2 2.7-1.9 2.3L18 12l-1.7 3.2 1.9 2.3-1.2 2.7-3-.5L12 22l-2-2.3-3 .5-1.2-2.7 1.9-2.3L6 12l1.7-3.2-1.9-2.3L7 3.8l3 .5zm0 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6' fill='black'/%3E%3C/svg%3E");
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  border-color: rgba(255, 205, 53, 0.58);
  background: #fff5c8;
  box-shadow: 0 8px 18px rgba(219, 171, 34, 0.13);
}

.nav-item.active::before,
.nav-item:hover::before {
  background: #e2a90f;
}

.sidebar-card {
  position: absolute;
  right: 16px;
  bottom: 20px;
  left: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 205, 53, 0.48);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff6c9, #ffffff);
  box-shadow: 0 12px 28px rgba(214, 164, 28, 0.15);
}

.sidebar-card .ghost-button {
  width: 100%;
  margin-top: 12px;
  color: #8c6814;
  background: #ffffff;
}

.mini-lemon,
.tiny-lemon {
  position: relative;
  width: 54px;
  height: 48px;
  margin-bottom: 10px;
}

.mini-lemon::before,
.tiny-lemon::before {
  content: "";
  position: absolute;
  inset: 5px 8px 4px 6px;
  border: 1px solid rgba(221, 168, 27, 0.34);
  border-radius: 48% 52% 50% 46%;
  background:
    radial-gradient(circle at 38% 42%, #4a3e21 0 2px, transparent 2.5px),
    radial-gradient(circle at 62% 42%, #4a3e21 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 59%, #e98f61 0 3px, transparent 3.5px),
    linear-gradient(145deg, #fff28f, #ffd13a);
  box-shadow: 0 10px 20px rgba(214, 164, 28, 0.18);
}

.mini-lemon::after,
.tiny-lemon::after {
  content: "";
  position: absolute;
  top: 0;
  right: 12px;
  width: 15px;
  height: 9px;
  border-radius: 12px 2px 12px 2px;
  background: #60bf72;
  transform: rotate(22deg);
}

.tiny-lemon {
  width: 32px;
  height: 30px;
  margin: 0;
}

.sidebar-card span,
.sidebar-card p {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-card strong {
  display: block;
  margin: 6px 0;
}

.main {
  min-width: 0;
  width: 100%;
  padding: 24px;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  margin: -24px -24px 24px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(234, 223, 189, 0.75);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
}

.topbar h2 {
  margin-top: 4px;
  font-size: 30px;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.workspace-name {
  font-size: 17px;
}

.assistant-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 205, 53, 0.7);
  border-radius: var(--radius);
  color: #4b3b11;
  background: #fff3ba;
  font-weight: 800;
}

.assistant-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lemon);
  font-size: 11px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
}

.user-chip p,
.user-chip strong {
  margin: 0;
}

.user-chip p {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #d67b58, #6b432c);
  font-weight: 900;
}

.page-heading {
  display: none;
}

.eyebrow,
.label {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.primary-button,
.ghost-button,
.text-button {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 14px;
  border: 1px solid transparent;
}

.primary-button {
  color: #2f2c16;
  background: linear-gradient(180deg, #ffe780, #ffd33d);
  box-shadow: 0 10px 20px rgba(219, 171, 34, 0.22);
  font-weight: 800;
}

.ghost-button {
  color: var(--text);
  border-color: rgba(234, 223, 189, 0.98);
  background: var(--surface);
}

.text-button {
  color: var(--green-dark);
  background: transparent;
  padding: 0;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffef9;
}

select,
input {
  height: 40px;
}

textarea {
  min-height: 92px;
  padding-top: 10px;
  line-height: 1.55;
  resize: vertical;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 108px;
  margin-bottom: 10px;
}

.dashboard-hero h3 {
  margin: 0 0 10px;
  font-size: 28px;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}

.sun-icon {
  color: #f6bf22;
}

.reading-lemon {
  position: relative;
  width: 260px;
  height: 112px;
}

.lemon-body {
  position: absolute;
  right: 70px;
  bottom: 8px;
  width: 84px;
  height: 92px;
  border: 1px solid rgba(221, 168, 27, 0.32);
  border-radius: 46% 54% 50% 50%;
  background:
    radial-gradient(circle at 35% 38%, #4a3e21 0 3px, transparent 3.5px),
    radial-gradient(circle at 62% 38%, #4a3e21 0 3px, transparent 3.5px),
    radial-gradient(circle at 28% 54%, #ffad7d 0 7px, transparent 8px),
    radial-gradient(circle at 72% 54%, #ffad7d 0 7px, transparent 8px),
    linear-gradient(145deg, #fff39a, #ffd13d);
  box-shadow: 0 16px 30px rgba(214, 164, 28, 0.18);
}

.lemon-face {
  position: absolute;
  top: 44px;
  left: 25px;
  color: #74551c;
  font-size: 15px;
  font-weight: 900;
}

.lemon-book {
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 48px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(90deg, #58a9e8 0 48%, #3c8ed3 49% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.lemon-leaf {
  position: absolute;
  top: 10px;
  right: 92px;
  width: 34px;
  height: 18px;
  border-radius: 30px 4px 30px 4px;
  background: #67bf69;
  transform: rotate(18deg);
}

.lemon-cup,
.lemon-plant {
  position: absolute;
  bottom: 9px;
}

.lemon-cup {
  right: 28px;
  width: 36px;
  height: 28px;
  border: 4px solid #d8a550;
  border-radius: 4px 4px 12px 12px;
  background: #fff;
}

.lemon-plant {
  right: 0;
  width: 28px;
  height: 50px;
  border-bottom: 10px solid #d9b568;
}

.lemon-plant::before,
.lemon-plant::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 10px;
  border-radius: 16px 2px 16px 2px;
  background: #76c982;
}

.lemon-plant::before {
  top: 12px;
  left: 2px;
  transform: rotate(45deg);
}

.lemon-plant::after {
  top: 24px;
  right: 0;
  transform: rotate(-20deg);
}

.panel,
.kpi-card,
.book-card,
.connector-card,
.mini-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 35px rgba(123, 105, 45, 0.08);
}

.detail-panel,
.list-panel {
  min-width: 0;
}

.panel {
  padding: 18px;
}

.panel-header,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header h3,
.section-head h3 {
  margin-top: 4px;
  font-size: 20px;
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--lemon), #82dca3, #9bcfff);
}

.kpi-card span,
.kpi-card p {
  color: var(--muted);
  font-size: 13px;
}

.kpi-card strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
}

.metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-style: normal;
}

.metric-icon::before {
  content: "";
  width: 28px;
  height: 28px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.metric-icon.clipboard {
  color: #28a968;
  background: #dff8e8;
}

.metric-icon.clipboard::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 3h6l1 2h2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2zm0 4v2h6V7zm-1 6h8v2H8zm0 4h6v2H8z' fill='black'/%3E%3C/svg%3E");
}

.metric-icon.clock {
  color: #dfa615;
  background: #fff3ca;
}

.metric-icon.clock::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20m1 5h-2v6l5 3 1-1.7-4-2.3z' fill='black'/%3E%3C/svg%3E");
}

.metric-icon.chat {
  color: #368fe2;
  background: #e3f1ff;
}

.metric-icon.chat::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3h-5l-5 5v-5a3 3 0 0 1-3-3zm5 4a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3m6 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3' fill='black'/%3E%3C/svg%3E");
}

.metric-icon.person {
  color: #eb6874;
  background: #ffe7e7;
}

.metric-icon.person::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10m0 2c-4 0-8 2.2-8 5v2h16v-2c0-2.8-4-5-8-5' fill='black'/%3E%3C/svg%3E");
}

.dashboard-layout,
.workspace-grid,
.segment-layout,
.settings-grid,
.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 14px;
}

#dashboard .dashboard-layout {
  grid-template-columns: minmax(0, 1fr) 316px;
}

#dashboard .dashboard-layout > .panel:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

#dashboard .dashboard-layout > .panel:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.ai-assistant-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  border-color: rgba(255, 205, 53, 0.68);
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.assistant-head h3 {
  font-size: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-actions button {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.quick-actions strong {
  font-size: 13px;
}

.quick-actions em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.handoff-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.handoff-tabs button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fffdf8;
  font-size: 12px;
  font-weight: 800;
}

.handoff-tabs button.active {
  color: #4b3b11;
  border-color: rgba(255, 205, 53, 0.72);
  background: #fff1b7;
}

.handoff-inbox {
  display: grid;
  gap: 10px;
}

.inbox-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.inbox-card.red {
  border-color: rgba(233, 95, 95, 0.28);
  background: #fff7f4;
}

.inbox-card.green {
  border-color: rgba(61, 188, 120, 0.24);
  background: #f5fff8;
}

.inbox-card strong {
  line-height: 1.45;
  font-size: 13px;
}

.inbox-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 12px;
}

.inbox-card b {
  color: var(--text);
}

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

.inbox-top small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.inbox-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inbox-actions .primary-button,
.inbox-actions .ghost-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.small-action {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.small-action::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
}

.small-action.green {
  color: #2fb56e;
  background: #e5f8eb;
}

.small-action.yellow {
  color: #dfaa1a;
  background: #fff3cc;
}

.small-action.blue {
  color: #378fe0;
  background: #e3f1ff;
}

.small-action.coral {
  color: #ed6c72;
  background: #ffeded;
}

.recent-box,
.handoff-policy {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.recent-box div,
.handoff-policy div {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.assistant-input {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid rgba(255, 205, 53, 0.62);
  border-radius: var(--radius);
  background: #fffdf2;
}

.assistant-input span {
  color: var(--muted);
  font-size: 13px;
}

.assistant-input button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #5b4815;
  background: var(--lemon);
}

.org-table,
.alert-list,
.org-list,
.detail-grid,
.library-grid,
.asset-list,
.rule-card-list,
.handoff-list,
.rule-builder,
.config-list,
.guard-list,
.connector-grid {
  display: grid;
  gap: 10px;
}

.table-row,
.alert-item,
.org-item,
.detail-card,
.book-card,
.asset-row,
.rule-card,
.handoff-row,
.campaign-box,
.connector-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.table-row:hover,
.book-card:hover,
.asset-row:hover,
.rule-card:hover,
.handoff-row:hover,
.connector-card:hover {
  border-color: rgba(255, 205, 53, 0.65);
  background: #fffaf0;
}

.table-row {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.8fr auto;
  gap: 12px;
  align-items: center;
}

.table-row strong,
.org-item strong,
.detail-card strong,
.book-card strong {
  display: block;
  margin-bottom: 5px;
}

.table-row p,
.alert-item p,
.org-item p,
.detail-card p,
.book-card p,
.asset-row p,
.rule-card p,
.handoff-row p,
.campaign-box p,
.connector-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 8px;
  color: #9a6513;
  border: 1px solid rgba(217, 151, 34, 0.28);
  border-radius: 6px;
  background: #fff2cd;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.green {
  color: var(--green-dark);
  border-color: rgba(61, 188, 120, 0.24);
  background: #e7faee;
}

.status-pill.red {
  color: var(--red);
  border-color: rgba(233, 95, 95, 0.22);
  background: #fff0ed;
}

.org-item {
  text-align: left;
  color: var(--text);
  border-color: var(--line);
}

.org-item.active {
  border-color: rgba(255, 205, 53, 0.62);
  background: #fff7d8;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-knowledge {
  margin-top: 14px;
}

.knowledge-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

.knowledge-toolbar input,
.knowledge-toolbar select {
  min-height: 42px;
}

.knowledge-count,
.knowledge-meta {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.knowledge-tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #596273;
  font-size: 11px;
}

.knowledge-details {
  margin-top: 10px;
  color: var(--text);
}

.knowledge-details summary {
  cursor: pointer;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.knowledge-details h4 {
  margin: 12px 0 4px;
}

.knowledge-details ul {
  margin: 4px 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.knowledge-details a {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.empty-knowledge {
  color: var(--muted);
}

.asset-row,
.rule-card,
.handoff-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 720px) {
  .knowledge-toolbar {
    grid-template-columns: 1fr;
  }
}

.rule-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.book-card {
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.book-meta span {
  padding: 5px 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.plan-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 14px;
}

.step-rail {
  display: grid;
  gap: 10px;
  align-content: start;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.step.active {
  border-color: rgba(255, 205, 53, 0.65);
  background: #fff4c0;
}

.step.active span {
  color: #2f2c16;
  border-color: transparent;
  background: var(--lemon);
  font-weight: 900;
}

.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.form-stack,
.config-list {
  display: grid;
  gap: 12px;
}

.form-stack label,
.config-list label,
.action-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.action-panel {
  margin-bottom: 14px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.action-grid label:last-child {
  grid-column: 1 / -1;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.inline-notice {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.sub-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 205, 53, 0.5);
  border-radius: var(--radius);
  background: #fff9df;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff9df;
}

.plan-preview h4 {
  margin: 0 0 12px;
}

.auto-reply-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f2fff6;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.preview-stack {
  display: grid;
  gap: 10px;
}

.mini-box {
  padding: 12px;
  background: #ffffff;
}

.mini-box span {
  color: var(--muted);
  font-size: 12px;
}

.mini-box strong {
  display: block;
  margin-top: 6px;
}

.rule-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
}

.rule-row span {
  color: var(--muted);
}

.campaign-box {
  display: grid;
  gap: 12px;
}

.handoff-panel {
  grid-column: 1 / -1;
}

.report-summary {
  display: grid;
  gap: 12px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.push-config {
  display: grid;
  gap: 12px;
}

.push-config label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.guard-list p {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.connector-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.connector-card {
  display: grid;
  gap: 8px;
}

.connector-card .ghost-button {
  justify-self: start;
  min-height: 34px;
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-card {
    position: static;
    margin-top: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-layout,
  .workspace-grid,
  .segment-layout,
  .settings-grid,
  .report-layout,
  .settings-workspace,
  .plan-shell,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .library-grid,
  .connector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .top-actions,
  .panel-header,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .top-actions button {
    width: 100%;
  }

  .nav-list,
  .kpi-grid,
  .report-kpis,
  .detail-grid,
  .action-grid,
  .two-col,
  .library-grid,
  .connector-grid,
  .table-row,
  .asset-row,
  .rule-card,
  .handoff-row,
  .rule-row {
    grid-template-columns: 1fr;
  }
}
