/* Projects360 visual layer: readable type, clear hierarchy, and consistent colors. */
:root {
  font-family: Rubik, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  color: #192744;
  background: #f3f6fb;
  --ink: #192744;
  --muted: #60708a;
  --line: #dce4ef;
  --accent: #365bd2;
  --accent-soft: #eaf0ff;
  --shadow: 0 9px 28px rgba(28, 49, 84, .055);
}
html[lang="en"] { font-family: Rubik, "Segoe UI", Arial, sans-serif; }
body { background: #f3f6fb; color: var(--ink); }
button, input, select, textarea { font-family: inherit; }
button:focus-visible, [role="tab"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline-color: #365bd2;
}

/* Workspace frame */
.app-shell { grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { background: #fff; border-inline-end-color: #dce4ef; }
.brand { color: #172640; font-weight: 800; letter-spacing: -.6px; }
.brand-mark { background: linear-gradient(145deg, #1c3568, #3d61d1); box-shadow: 0 8px 20px #2848952b; }
.brand-mark span { color: #86e5d4; }
.brand small { color: #4777ce; }
.workspace-box { background: linear-gradient(135deg, #edf3ff, #f8fbff); border-color: #dbe5f7; border-radius: 12px; }
.workspace-label, .nav-title { color: #62718b; }
.workspace-avatar, .avatar { background: #e6edff; color: #3154b5; }
.nav-button { color: #465571; font-size: 13px; font-weight: 600; min-height: 41px; }
.nav-button:hover { background: #f1f5ff; color: #284aaa; }
.nav-button.active { background: #e9efff; color: #284fb8; }
.nav-button.active .nav-icon { color: #365bd2; }
.nav-button .nav-count { background: #e9edf5; color: #50617d; }
.sidebar-bottom { border-color: #e3e9f2; }
.topbar { background: #fff; border-bottom-color: #dce4ef; min-height: 66px; }
.breadcrumb { color: #697791; }
.breadcrumb b { color: #21304e; }
.global-search { background: #f6f8fc; border-color: #e1e8f1; border-radius: 10px; }
.global-search input { color: #243251; }
.lang-switch { color: #3559c5; border-color: #dbe4f3; font-weight: 750; }
.page { background: radial-gradient(ellipse at 85% 0%, #eaf0ff 0, transparent 35%), #f3f6fb; padding-top: 31px; }
.eyebrow { color: #4268cc; letter-spacing: 1px; font-weight: 800; }
.page-title { color: #172540; font-size: 30px; letter-spacing: -.7px; font-weight: 780; }
.page-subtitle { color: #62718a; font-size: 14px; }

/* Buttons and surfaces */
.primary-btn { background: #365bd2; box-shadow: 0 5px 15px #365bd234; font-weight: 700; }
.primary-btn:hover { background: #294dbb; }
.secondary-btn { background: #fff; border-color: #d6e0ee; color: #354663; }
.secondary-btn:hover { border-color: #8fa8e6; color: #2d54be; background: #f8faff; }
.link-button, .clear-filter { color: #3159c9; font-size: 12px; }
.panel, .project-card, .stat-card { border-color: #dce4ef; box-shadow: var(--shadow); }
.panel-head { border-bottom-color: #e5ebf3; padding: 19px 21px; }
.panel-title { color: #202e4c; font-size: 16px; font-weight: 750; }
.panel-subtitle { color: #687892; font-size: 12px; }
.panel-body { padding: 19px 21px; }
.small-muted { color: #697892; }

/* At-a-glance metrics */
.stats-grid { gap: 14px; }
.stat-card { position: relative; overflow: hidden; min-height: 124px; border-radius: 14px; padding: 18px 19px; --tone: #6c62d6; --tone-soft: #eeecff; }
.stat-card::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--tone); }
.stat-tone-violet { --tone: #6c62d6; --tone-soft: #eeecff; }
.stat-tone-orange { --tone: #c97719; --tone-soft: #fff1df; }
.stat-tone-green { --tone: #187c64; --tone-soft: #def7ed; }
.stat-tone-blue { --tone: #3474c8; --tone-soft: #e6f1ff; }
.stat-tone-red { --tone: #bd3e5c; --tone-soft: #ffe7ed; }
.stat-card .stat-icon { background: var(--tone-soft); color: var(--tone); width: 39px; height: 39px; }
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-label { color: #52627d; font-size: 13px; font-weight: 700; }
.stat-value { color: #172642; font-size: 31px; letter-spacing: -.4px; font-weight: 780; }
.stat-foot { color: #9a3d50; font-size: 11px; font-weight: 650; }
.insight-stat:hover { border-color: #8ba4e5; box-shadow: 0 12px 28px #27449e1a; }

/* Overview panels */
.overview-grid { grid-template-columns: minmax(0, 1.7fr) minmax(270px, .82fr); align-items: start; }
.overview-stack { display: grid; gap: 18px; min-width: 0; }
.overview-grid > .panel { align-self: start; }
.mini-row, .activity-item { border-bottom-color: #edf1f6; }
.mini-title, .activity-text b { color: #243450; }
.mini-meta, .activity-time { color: #73819a; }
.activity-dot { background: #5f82d9; }
.project-pulse-list { padding: 8px 20px 13px; }
.project-pulse-row { width: 100%; display: grid; grid-template-columns: 5px minmax(100px, 1fr) minmax(72px, 1.2fr) 40px; align-items: center; gap: 11px; padding: 12px 2px; border: 0; border-bottom: 1px solid #edf1f6; background: transparent; text-align: start; color: #263653; }
.project-pulse-row:last-child { border-bottom: 0; }
.project-pulse-row:hover { background: #f7faff; }
.project-pulse-mark { width: 5px; height: 31px; border-radius: 5px; }
.project-pulse-name { min-width: 0; display: grid; gap: 2px; }
.project-pulse-name strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-pulse-name small { color: #70809a; font-size: 10px; }
.project-pulse-meter { display: block; height: 8px; border-radius: 99px; background: #e9eef5; overflow: hidden; }
.project-pulse-meter span { display: block; height: 100%; border-radius: inherit; }
.project-pulse-row b { text-align: end; font-size: 11px; color: #43536f; }

/* Work boards */
.board-toolbar { background: #fcfdff; border-bottom-color: #e5ebf3; padding: 15px 18px; }
.segmented { background: #edf2fa; }
.segmented button { color: #53647e; font-size: 12px; font-weight: 700; }
.segmented button.active { color: #2f56c2; box-shadow: 0 2px 6px #29436f17; }
.filter-select, .sort-control { border-color: #d6e0ed; color: #394b66; min-height: 38px; }
.sort-control select { color: #394b66; }
.saved-view { background: #e9efff; color: #3157bd; }
.tabbar button.active { color: #3159c9; border-bottom-color: #365bd2; }
.board-count { color: #5c6a82; font-weight: 650; }
.group-heading strong { font-size: 15px; }
.group-heading small, .group-summary { color: #5b6c85; font-size: 12px; }
.group-meter { background: #e8edf5; }
.group-meter-segment.todo { background: #93a1b7; }
.group-meter-segment.working { background: #e4a34c; }
.group-meter-segment.stuck { background: #da6177; }
.group-meter-segment.done { background: #2da77c; }
.table-header { background: #edf2f9; color: #475a76; border-color: #dce4ef; font-size: 12px; font-weight: 750; }
.table-row { min-height: 49px; border-color: #dce4ef; }
.table-row:hover { background: #f7faff; border-color: #a7b9e6; }
.table-cell { color: #3e4d66; border-inline-end-color: #ebeff5; font-size: 13px; }
.row-title, .table-link { color: #20304c; font-size: 13px; font-weight: 680; }
.row-title:hover, .table-link:hover { color: #3158c6; }
.row-updates:hover, .row-edit:hover, .group-add:hover, .group-collapse:hover { background: #e9efff; color: #3158c6; }
.cell-select, .cell-date, .cell-input { color: #354762; font-size: 12px; }
.task-done-check { accent-color: #258968; }
.pill { font-size: 11px; font-weight: 750; }
.pill.todo, .pill.planning, .pill.new, .pill.open { background: #e9edf4; color: #43536c; }
.pill.working, .pill.active, .pill.qualified, .pill.in_progress { background: #fff0d6; color: #895400; }
.pill.stuck, .pill.on_hold, .pill.lost, .pill.urgent { background: #ffe4ea; color: #a52e4b; }
.pill.done, .pill.complete, .pill.won, .pill.resolved { background: #dcf5e9; color: #13694e; }
.pill.high, .pill.proposal { background: #f5e7f7; color: #754085; }
.pill.medium, .pill.negotiation, .pill.waiting { background: #e8ecff; color: #485ab3; }
.pill.low { background: #e5f1ff; color: #235e8c; }
.status-select { font-size: 11px; }
.kanban-col { background: #f3f6fb; border-color: #dfe6ef; }
.kanban-card { border-color: #dce4ef; box-shadow: 0 4px 12px #27395b0a; }
.kanban-card:hover { border-color: #8fa9e5; }
.project-card:hover, .project-card.selected { border-color: #8fa9e5; box-shadow: 0 10px 25px #2e53b217; }
.kanban-card strong { color: #20304c; font-size: 13px; }
.kanban-card small { color: #64748e; font-size: 11px; }
.calendar-weekday, .timeline-title, .timeline-header { background: #edf2f9; color: #465a78; }
.calendar-task { background: #e8efff; color: #3158bb; font-size: 11px; }
.calendar-task:hover { background: #d9e5ff; }
.timeline-day.today { background: #e4edff; color: #3159c9; }
.columns-menu label:hover { background: #f0f5ff; }
.columns-menu input { accent-color: #365bd2; }
.timeline-bar.todo { background: #93a1b7; }
.timeline-bar.working { background: #e4a34c; }
.timeline-bar.stuck { background: #da6177; }
.timeline-bar.done { background: #2da77c; }

/* Reporting */
.donut-layout { min-height: 246px; }
.donut-visual { width: 170px; height: 170px; }
.donut-center strong { color: #172642; font-size: 32px; }
.donut-center span, .donut-legend-row small { color: #64748d; }
.donut-legend-row { color: #3f506e; font-size: 12px; border-bottom-color: #e8edf4; }
.donut-legend-row:hover, button.owner-chart-row:hover { background: #f2f6ff; }
.owner-chart { align-content: start; min-height: 246px; padding: 19px 21px; gap: 11px; }
.owner-chart-kpi { display: flex; align-items: baseline; gap: 9px; padding: 2px 7px 13px; border-bottom: 1px solid #e8edf5; color: #60708b; font-size: 12px; }
.owner-chart-kpi strong { color: #294fbd; font-size: 26px; line-height: 1; }
.owner-chart-row { color: #394b66; font-size: 12px; }
.owner-chart-track { background: #e9eef6; height: 18px; }
.owner-chart-track span { background: linear-gradient(90deg, #3c79d8, #5b9bea); }
.owner-coverage { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: auto; padding: 18px 7px 2px; border-top: 1px solid #e8edf5; color: #61718a; font-size: 11px; }
.owner-coverage strong { color: #284fbb; font-size: 12px; }
.owner-coverage-track { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: #e8eef7; overflow: hidden; }
.owner-coverage-track span { display: block; height: 100%; border-radius: inherit; background: #3c79d8; }
.metric-track { background: #e9eef6; }
.metric-fill { background: #5d7fe0; }
.metric-fill.done, .metric-fill.won, .metric-fill.resolved { background: #2da77c; }
.metric-fill.stuck, .metric-fill.lost { background: #da6177; }
.metric-fill.working, .metric-fill.proposal, .metric-fill.in_progress { background: #e4a34c; }
.progress-fill { background: #4d75d9; }

/* Forms and detail panels */
.field label { color: #394b67; font-size: 12px; }
.field input, .field select, .field textarea, .comment-form textarea { border-color: #d7e1ee; color: #243653; font-size: 13px; }
.drawer-head h2, .modal-head h2 { color: #1e2d49; }
.drawer-tabs button.active { color: #3158c6; border-bottom-color: #365bd2; }
.comment-bubble { background: #f2f6fb; color: #354864; }
.rule-icon { background: #e9efff; color: #365bd2; }
.auth-art { background: radial-gradient(circle at 20% 13%, #4b78d76e, transparent 34%), radial-gradient(circle at 90% 90%, #29a69b4d, transparent 37%), #172b54; }
.auth-art .brand-mark { background: #ffffff28; }
.auth-card h2 { color: #1c2b47; }
.auth-card > p, .auth-switch { color: #65748f; }
.auth-switch button { color: #3159c9; }
.auth-card { width: min(420px, 100%); }
.auth-card > p { font-size: 14px; }
.auth-card .field input { font-size: 15px; }
.auth-steps {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  list-style: none; padding: 0; margin: 0 0 20px; font-size: 12px; color: #63718b;
}
.auth-steps li { display: inline-flex; gap: 7px; align-items: center; }
.auth-steps li span {
  display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: #edf0f6; font-weight: 700;
}
.auth-steps [aria-current="step"] { color: #3159c9; font-weight: 700; }
.auth-steps [aria-current="step"] span { background: #e7edff; }
.auth-card .field input.auth-code {
  text-align: center; letter-spacing: .36em; font-size: 24px; font-weight: 700; min-height: 52px;
}
.auth-card .field small { color: #63718b; font-size: 12px; }
.auth-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.auth-actions button, .auth-switch button {
  padding: 4px 0; min-height: 32px; border: 0; background: transparent;
  color: #3159c9; font-size: 13px; font-weight: 600;
}
.auth-actions button:disabled { color: #63718b; cursor: default; }
.auth-actions button:not(:disabled):hover, .auth-switch button:hover { text-decoration: underline; }
.auth-error { margin-top: 12px; font-size: 13px; line-height: 1.45; color: #a92442; }
.auth-switch { font-size: 13px; margin-top: 16px; }

/* Platform user directory */
.platform-shell { min-height: 100vh; background: #f3f6fb; }
.platform-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 12px; padding: 12px clamp(16px,4vw,56px); background: #fff; border-bottom: 1px solid var(--line);
}
.platform-header .brand { padding: 0; }
.platform-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.platform-nav { text-decoration: none; }
.platform-main { max-width: 1440px; margin: 0 auto; padding: 34px clamp(14px,4vw,56px) 58px; }
.platform-stats {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 20px;
}
.platform-stats .stat-card { min-height: 108px; }
.platform-columns { display: grid; gap: 16px; align-items: start; }
.platform-columns.with-profile { grid-template-columns: minmax(0,1fr) minmax(280px,340px); }
.platform-card {
  min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow);
}
.platform-directory-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px; color: var(--muted); font-size: 13px;
}
.platform-directory-tools form { display: flex; gap: 8px; width: min(100%,420px); }
.platform-directory-tools input {
  min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  color: var(--ink); background: #f8faff;
}
.platform-table-scroll { overflow: auto; }
.platform-table { width: 100%; min-width: 610px; border-collapse: collapse; text-align: start; }
.platform-table th, .platform-table td { text-align: start; padding: 9px 14px; border-top: 1px solid var(--line); }
.platform-table th { background: #f6f8fc; color: #4d5d77; font-size: 12px; white-space: nowrap; }
.platform-table td { font-size: 13px; color: var(--muted); }
.platform-table td:nth-last-child(-n+2) { white-space: nowrap; }
.platform-table tbody tr:hover { background: #f8faff; }
.platform-user {
  display: inline-flex; align-items: center; gap: 8px; text-align: start; padding: 4px;
  background: transparent; border: 0; border-radius: 8px; color: #244aaf; font-weight: 700;
}
.platform-user:hover, .platform-user[aria-expanded="true"] { background: var(--accent-soft); }
.platform-user .avatar { flex: none; }
.platform-count {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px;
  color: #284da9; background: var(--accent-soft); font-size: 11px; font-weight: 700;
}
.platform-pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted);
}
.platform-empty { margin: 0; padding: 24px; color: var(--muted); }
.platform-profile { padding: 18px; overflow-wrap: anywhere; }
.platform-profile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.platform-profile-top .eyebrow { margin: 0; }
.platform-profile h2 { margin: 8px 0 2px; font-size: 22px; }
.platform-profile > p { margin: 0 0 16px; color: var(--muted); }
.platform-profile h3 { margin: 17px 0 8px; font-size: 14px; }
.platform-facts, .platform-workspace dl { margin: 0; display: grid; gap: 8px; }
.platform-facts { grid-template-columns: repeat(2,minmax(0,1fr)); padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.platform-profile dt { color: var(--muted); font-size: 11px; }
.platform-profile dd { margin: 2px 0 0; font-weight: 650; font-size: 12px; }
.platform-workspace { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-top: 8px; }
.platform-workspace > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.platform-workspace dl { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 9px; }
@media (max-width: 820px) {
  .platform-columns.with-profile { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 570px) {
  .platform-stats { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .platform-stats .stat-card { min-height: 76px; }
}

/* Help assistant */
.help-launcher {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  padding: 0; border: 1px solid #d6e0ee; border-radius: 10px; background: #fff; color: #3159c9;
}
.help-launcher:hover { border-color: #a3b7ee; background: #edf2ff; }
.help-launcher svg { width: 21px; height: 21px; }
.help-drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0;
  height: 100dvh; max-height: none; width: min(420px,100vw); max-width: none;
  border: 0; background: #fff; color: var(--ink); box-shadow: 16px 0 48px #19274435;
}
.help-drawer[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.help-drawer::backdrop { background: #19274465; }
.help-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.help-header h2 { margin: 0; font-size: 20px; }
.help-content { overflow: auto; padding: 20px; }
.help-content > label { display: block; margin-bottom: 6px; font-weight: 650; }
.help-content > input {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 9px; color: var(--ink); background: #f8faff;
}
.help-content > h3 { margin: 20px 0 8px; font-size: 14px; }
.help-welcome { border-radius: 12px; margin-bottom: 20px; padding: 16px; background: #edf2ff; }
.help-welcome h3 { margin: 0 0 5px; font-size: 17px; color: #203f8e; }
.help-welcome p { margin: 0; color: #415779; line-height: 1.65; }
.help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.help-results details { margin: 7px 0; border: 1px solid var(--line); border-radius: 9px; }
.help-results summary { cursor: pointer; padding: 11px; font-weight: 650; }
.help-results details[open] summary { color: #3159c9; background: #f8faff; }
.help-results p { padding: 0 11px 11px; margin: 4px 0 0; color: #52637c; line-height: 1.65; }

@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .page { padding: 24px 18px 55px; }
  .page-title { font-size: 25px; }
  .sidebar { width: 252px; }
}
@media (max-width: 520px) {
  .page-title { font-size: 24px; }
  .stat-card { min-height: 112px; padding: 15px; }
  .stat-value { font-size: 27px; }
  .stat-label { font-size: 12px; }
  .board-toolbar-right { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .board-toolbar-right > .filter-select, .board-toolbar-right > .sort-control, .board-toolbar-right > .columns-wrap,
  .board-toolbar-right > .secondary-btn, .board-toolbar-right > .primary-btn, .board-toolbar-right > .clear-filter {
    width: 100%; min-width: 0; max-width: none; margin: 0;
  }
  .board-toolbar-right .sort-control select { width: 100%; min-width: 0; max-width: none; font-size: 11px; }
  .board-toolbar-right .columns-wrap .secondary-btn { width: 100%; }
  .project-pulse-row { grid-template-columns: 5px minmax(90px, 1fr) minmax(45px, .8fr) 34px; gap: 7px; }
  .project-pulse-list { padding: 8px 13px 12px; }
  .donut-visual { width: 150px; height: 150px; }
}

/* Named boards and the workspace board list. */
.sidebar { overflow-y: auto; scrollbar-width: thin; }
.sidebar-boards { margin: 20px 4px; padding-top: 15px; border-top: 1px solid #e5ebf4; }
.sidebar-board-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px; color: #63738c; font-size: 11px; font-weight: 750; }
.icon-button { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #71809a; flex: none; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { background: #e9efff; color: #3158c6; }
.sidebar-board-row { display: flex; align-items: center; min-width: 0; border-radius: 7px; margin: 3px 0; }
.sidebar-board-row > button:first-child { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 9px 10px; flex: 1; min-width: 0; text-align: start; color: #465775; font-size: 12px; }
.sidebar-board-row > button:first-child > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-board-row:hover, .sidebar-board-row.active { background: #eaf0ff; }
.sidebar-board-row.active > button:first-child { color: #2d54bc; font-weight: 700; }
.sidebar-board-dot { display: inline-block; width: 9px; height: 13px; border-radius: 3px; flex: none; }
.board-gallery-toolbar, .board-gallery-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-gallery-toolbar { justify-content: space-between; margin-bottom: 22px; }
.board-categories { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid #dce4ef; border-radius: 11px; background: #fff; }
.board-categories button { border: 0; border-radius: 7px; background: transparent; color: #5a6c87; padding: 8px 12px; font-size: 12px; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.board-categories button.active { color: #3158c6; background: #eaf0ff; }
.board-categories button span { font-size: 10px; color: #71819a; }
.board-categories button.active span { color: #3158c6; }
.project-card { position: relative; padding: 0; overflow: hidden; border-radius: 15px; cursor: auto; transition: border-color .16s, box-shadow .16s, transform .16s; }
.project-card::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 0; height: 4px; background: var(--board-color, #365bd2); }
.project-card:has(.project-card-main:hover) { transform: translateY(-2px); }
.project-card-main { display: block; width: 100%; background: transparent; border: 0; text-align: start; padding: 21px 19px 16px; color: inherit; }
.project-card-manage { position: absolute; top: 17px; inset-inline-end: 14px; z-index: 1; background: #f3f6fb; }
.project-card-main:focus-visible { outline: 2px solid #365bd2; outline-offset: -4px; border-radius: 12px; }
.project-card-top { justify-content: flex-start; align-items: center; margin-bottom: 17px; padding-inline-end: 30px; }
.board-type-mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: var(--board-color, #365bd2); background: color-mix(in srgb, var(--board-color, #365bd2) 11%, white); flex: none; }
.board-type-mark svg { width: 21px; height: 21px; }
.board-kind { font-size: 11px; color: #60728e; font-weight: 650; }
.project-name { font-size: 17px; color: #21314f; }
.project-desc { color: #71819a; font-size: 12px; min-height: 19px; margin-top: 7px; }
.project-progress { font-size: 11px; color: #65758f; margin-top: 22px; }
.project-progress strong { color: #3d4e6b; }
.project-card .progress-track { height: 6px; background: #edf1f7; }
.project-foot { font-size: 11px; color: #60718e; margin-top: 17px; }
.project-open-label { margin-inline-start: auto; color: #355dce; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.project-open-label svg { width: 15px; height: 15px; }
html[dir="rtl"] .project-open-label svg { transform: rotate(180deg); }
.project-card-bottom { display: flex; align-items: center; justify-content: space-between; padding: 10px 19px; background: #f9fbfe; border-top: 1px solid #e9edf5; color: #7a89a0; font-size: 11px; }
.project-card-bottom .pill { padding: 3px 9px; min-width: 65px; font-size: 10px; }
.new-board-tile { border: 1.5px dashed #c8d5ec; border-radius: 15px; background: #f7faff; color: #3c63c3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 28px; min-height: 250px; }
.new-board-tile:hover { background: #eff5ff; border-color: #86a1db; }
.new-board-tile svg { width: 30px; height: 30px; }
.new-board-tile strong { font-size: 15px; }
.new-board-tile span { font-size: 11px; color: #7c8ba3; max-width: 220px; line-height: 1.7; }
.board-back { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0; color: #5c73a0; font-size: 12px; margin-bottom: 20px; }
.board-back svg { width: 15px; height: 15px; }
html[dir="ltr"] .board-back svg { transform: rotate(180deg); }
.board-identity { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.board-identity .board-type-mark { width: 48px; height: 48px; margin-top: 8px; }
.board-page-heading .page-title { overflow-wrap: anywhere; }
.board-page-heading .page-subtitle { margin-bottom: 0; }
.page-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.project-board-panel { overflow: hidden; }
.trash-panel { margin-top: 28px; }
.trash-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf1f7; }
.trash-row:last-child { border: 0; }
.trash-row > div { flex: 1; min-width: 0; }
.trash-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.trash-row small { display: block; color: #7b8ba2; font-size: 10px; margin-top: 4px; }

/* A single, elegant left side panel for creating and editing. */
body.panel-open { overflow: hidden; }
.overlay, .drawer-scrim { background: #142b4d26; backdrop-filter: blur(1px); }
.overlay { padding: 0; align-items: stretch; justify-content: flex-end; }
.modal, .drawer { position: fixed; inset-block: 0; inset-inline: auto; left: 0; right: auto; width: min(530px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0 18px 18px 0; box-shadow: 14px 0 54px #142c4c26; display: flex; flex-direction: column; overflow: hidden; animation: panel-in .2s ease-out; }
.modal-head, .drawer-head { flex: none; padding: 24px 25px 20px; min-height: 87px; background: #fbfcff; align-items: center; border-bottom: 1px solid #e2e9f3; }
.modal-head h2, .drawer-head h2 { margin: 0; font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
.modal-head small, .drawer-head small { display: block; font-size: 10px; color: #7184a4; margin-bottom: 5px; font-weight: 650; }
.modal-head .icon-close, .drawer-head .icon-close { width: 32px; height: 32px; background: #edf2fa; color: #6c7f9c; flex: none; }
.modal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-body, .drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 25px; scrollbar-width: thin; }
.modal-foot, .drawer-actions { flex: none; padding: 16px 25px; border-top: 1px solid #e2e9f3; background: #fff; margin-top: auto; }
.modal-foot .primary-btn, .drawer-actions .primary-btn { min-width: 94px; }
.form-section { border: 1px solid #e0e7f1; border-radius: 11px; margin-bottom: 14px; background: #fff; overflow: hidden; }
.form-section > summary { padding: 14px 15px; display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; font-size: 12px; color: #405575; font-weight: 750; user-select: none; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary svg { width: 16px; height: 16px; color: #92a0b6; transition: transform .15s; }
.form-section:not([open]) > summary svg { transform: rotate(90deg); }
.form-section[open] > summary { border-bottom: 1px solid #edf1f7; background: #f8faff; }
.form-section > .form-grid { padding: 17px 15px 19px; gap: 16px 12px; }
.field input, .field select { min-height: 41px; border-radius: 7px; }
.field textarea { min-height: 86px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8ca7e9; box-shadow: 0 0 0 3px #365bd20b; }
.field-help { font-size: 11px; line-height: 1.7; color: #7486a2; margin-top: 13px; }
.board-template-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.board-template-picker legend { font-size: 12px; font-weight: 700; color: #394b67; margin-bottom: 8px; }
.template-option { position: relative; display: flex !important; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e0e7f2; border-radius: 9px; cursor: pointer; background: #fff; }
.template-option:has(input:checked) { border-color: #7997df; background: #f1f5ff; box-shadow: 0 0 0 1px #365bd20d; }
.template-option input { position: absolute; opacity: 0; width: 1px !important; height: 1px; min-height: 0 !important; }
.template-option:has(input:focus-visible) { outline: 2px solid #365bd2; outline-offset: 2px; }
.template-icon { width: 32px; height: 32px; border-radius: 8px; background: #eaf0ff; color: #4d70c4; display: inline-grid; place-items: center; flex: none; }
.template-icon svg { width: 19px; height: 19px; }
.template-option strong { display: block; font-size: 12px; color: #2e456c; }
.template-option small { display: block; font-size: 10px; color: #7c8ba1; font-weight: 400; margin-top: 3px; }
.template-radio { margin-inline-start: auto; width: 15px; height: 15px; border: 1px solid #bcc9df; border-radius: 50%; flex: none; }
.template-option:has(input:checked) .template-radio { border: 4px solid #4267cc; background: #fff; }
.column-action-list { display: grid; gap: 9px; margin-top: 24px; }
.row-position-actions { padding: 10px 25px; display: flex; gap: 8px; border-top: 1px solid #edf1f7; }
.row-position-actions .secondary-btn { font-size: 11px; min-height: 32px; }
.delete-project-confirm { padding: 14px 25px; color: #94384b; background: #fff2f4; border-top: 1px solid #f0d6dd; font-size: 12px; }
.delete-project-confirm[hidden] { display: none; }
.delete-project-confirm p { margin-top: 0; line-height: 1.7; }
@keyframes panel-in { from { transform: translateX(-25px); opacity: .5; } to { transform: translateX(0); opacity: 1; } }

/* Direct manipulation of table columns, rows and kanban cards. */
.board-help { padding: 11px 20px 18px; display: flex; gap: 7px; align-items: center; color: #7c8aa0; font-size: 10px; line-height: 1.6; }
.board-help svg { width: 14px; height: 14px; flex: none; }
.drag-handle { border: 0; background: transparent; display: inline-grid; place-items: center; padding: 2px; color: #92a1b8; width: 18px; height: 26px; flex: none; cursor: grab; border-radius: 4px; }
.drag-handle svg { width: 13px; height: 17px; }
.drag-handle:hover, .drag-handle:focus-visible { background: #e3ecff; color: #365bd2; }
.drag-handle:active { cursor: grabbing; }
.column-heading { display: flex; gap: 3px; align-items: center; padding: 8px 6px !important; min-width: 0; position: relative; }
.column-heading > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-options { margin-inline-start: auto; width: 23px; height: 25px; opacity: .55; }
.column-heading:hover .column-options { opacity: 1; }
.task-name-cell { gap: 4px; padding-inline-start: 5px; }
.dragging { opacity: .35; }
.table-row, .kanban-card { position: relative; }
.drop-before { box-shadow: 0 -3px 0 #426de2 !important; }
.drop-after { box-shadow: 0 3px 0 #426de2 !important; }
.drop-column-before { box-shadow: inset 3px 0 0 #426de2; background: #dce7ff; }
.drop-column-after { box-shadow: inset -3px 0 0 #426de2; background: #dce7ff; }
html[dir="rtl"] .drop-column-before { box-shadow: inset -3px 0 0 #426de2; }
html[dir="rtl"] .drop-column-after { box-shadow: inset 3px 0 0 #426de2; }
.drop-group-active { outline: 2px dashed #8ba8eb; outline-offset: 3px; background: #edf3ff; }
.kanban-col { min-height: 170px; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.board-add-row { display: flex; align-items: center; gap: 7px; width: 100%; padding: 11px 15px; border: 1px dashed #dce4f0; border-radius: 0 0 6px 6px; background: #fbfcff; color: #8190a8; text-align: start; font-size: 11px; margin-top: 3px; }
.board-add-row:hover { color: #365bd2; background: #eff5ff; }
.board-add-row svg { width: 14px; height: 14px; }
.drag-handle, .column-heading { user-select: none; }
@media (max-width: 780px) {
  .board-gallery-toolbar { align-items: stretch; }
  .board-gallery-actions { width: 100%; }
  .board-categories { width: 100%; justify-content: space-between; }
  .board-categories button { padding: 8px 9px; }
  .board-identity .board-type-mark { width: 38px; height: 38px; }
  .board-identity { gap: 10px; }
}
@media (max-width: 520px) {
  .modal, .drawer { width: 100vw; border-radius: 0; }
  .modal-head, .drawer-head { padding: 19px 18px; min-height: 76px; }
  .modal-body, .drawer-scroll { padding: 18px; }
  .modal-foot, .drawer-actions { padding: 14px 18px; }
  .form-section > .form-grid { grid-template-columns: 1fr; padding: 16px 13px; }
  .template-option small { font-size: 10px; line-height: 1.6; }
  .drawer-action-buttons { gap: 6px; }
  .page-heading-actions { width: 100%; }
  .board-help { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { .modal, .drawer { animation: none; } .project-card { transition: none; } }

/* Projects360 agency workspace | additive, RTL-safe theme.
   Append after the existing theme; existing app layout and behavior are preserved. */

:root {
  --agency-plum: #493763;
  --agency-plum-dark: #3e2e55;
  --agency-sidebar-active: #605078;
  --agency-accent: #6851a1;
  --agency-accent-strong: #5b438d;
  --agency-violet: #f1eafa;
  --agency-white: #fff;
  --agency-canvas: #f7f7fa;
  --agency-ink: #252337;
  --agency-muted: #686679;
  --agency-line: #e8e6ed;
  --agency-line-dark: #d8d5df;
  --agency-shadow: 0 2px 6px rgba(35, 27, 55, .045);
  --agency-radius: 8px;
}

.app-shell { background: var(--agency-canvas); color: var(--agency-ink); font-size: 14px; }
.app-shell *, .agency-workspace * { box-sizing: border-box; }
.app-shell .sidebar {
  background: var(--agency-plum); color: #f7f4fb; border: 0;
  box-shadow: none; scrollbar-width: thin; scrollbar-color: #776b8d transparent;
}
.app-shell .sidebar .brand {
  color: #fff; padding: 20px 17px 15px; gap: 10px; font-size: 18px;
  line-height: 1.25; letter-spacing: -.02em; font-weight: 650;
}
.app-shell .sidebar .brand-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; flex: 0 0 35px;
  border-radius: 9px; border: 1px solid #a399ba; background: #fff; color: var(--agency-plum); box-shadow: none;
}
.app-shell .sidebar .brand-mark span { color: var(--agency-accent); }
.app-shell .sidebar .brand small { color: #d5cde4; font-size: 9px; letter-spacing: .04em; }
.app-shell .sidebar .workspace-box {
  margin: 5px 12px 14px; padding: 10px 9px; background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #ebe7f3;
}
.app-shell .sidebar .workspace-label, .app-shell .sidebar .nav-title,
.app-shell .sidebar .sidebar-board-heading, .app-shell .sidebar .agency-nav-heading,
.app-shell .sidebar .agency-nav-title, .app-shell .sidebar .nav-section-title {
  font-size: 11px; line-height: 1.4; font-weight: 650; color: #d6cde7;
  letter-spacing: .02em;
}
.app-shell .sidebar .workspace-avatar { background: #bcb0d7; color: #3e2e55; border-radius: 6px; }
.app-shell .sidebar .workspace-select {
  background: transparent; color: #fff; font-weight: 550; border: 0; min-width: 0;
}
.app-shell .sidebar .workspace-select option { color: var(--agency-ink); background: #fff; }
.app-shell .sidebar .nav-title { padding-inline: 19px; }
.app-shell .sidebar .nav-list { gap: 2px; padding-inline: 9px; }
.app-shell .sidebar .nav-button {
  width: 100%; min-height: 35px; padding: 7px 10px;
  display: flex; align-items: center; gap: 10px; border: 0; border-radius: 6px;
  background: transparent; color: #f5f0fb; text-decoration: none; font-size: 13px;
  font-weight: 450; line-height: 1.35; text-align: start;
}
.app-shell .sidebar .nav-button:hover,
.app-shell .sidebar .sidebar-board-row:hover { color: #fff; background: rgba(255,255,255,.085); }
.app-shell .sidebar .nav-button.active,
.app-shell .sidebar .sidebar-board-row.active {
  background: var(--agency-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #c3b2e5; font-weight: 650;
}
[dir="rtl"] .app-shell .sidebar .nav-button.active,
[dir="rtl"] .app-shell .sidebar .sidebar-board-row.active { box-shadow: inset -3px 0 0 #c3b2e5; }
.app-shell .sidebar .nav-icon { color: #d6cde7; width: 18px; flex: 0 0 18px; display: inline-grid; place-items: center; }
.app-shell .sidebar .nav-icon svg { width: 17px; height: 17px; }
.app-shell .sidebar .nav-button.active .nav-icon { color: #fff; }
.app-shell .sidebar .nav-count {
  margin-inline-start: auto; background: #6c5b86; color: #fff; min-width: 20px;
  border-radius: 99px; line-height: 18px; padding-inline: 6px; font-size: 10px; text-align: center;
}
.app-shell .sidebar :is(.agency-nav-heading,.agency-nav-title,.agency-nav-label,.nav-section-title) {
  padding: 12px 10px 5px; margin-block-start: 3px;
  border-top: 1px solid rgba(255,255,255,.095); color: #d6cde7; font-size: 11px; font-weight: 650;
}
.app-shell .sidebar .agency-nav-section { margin-block: 3px 5px; }
.app-shell .sidebar .sidebar-boards { border-color: rgba(255,255,255,.12); margin-top: 12px; }
.app-shell .sidebar .sidebar-board-heading { padding: 6px 13px 9px; }
.app-shell .sidebar .sidebar-board-row { margin-inline: 9px; border-radius: 6px; color: #ece6f6; }
.app-shell .sidebar .sidebar-board-row :is(button, a) { color: inherit; font-size: 12px; }
.app-shell .sidebar .sidebar-board-dot { width: 9px; height: 9px; border-radius: 3px; }
.app-shell .sidebar .icon-button, .app-shell .sidebar .logout { color: #e9e2f1; }
.app-shell .sidebar .icon-button:hover, .app-shell .sidebar .logout:hover { color: #fff; background: rgba(255,255,255,.1); }
.app-shell .sidebar .sidebar-bottom { border-color: rgba(255,255,255,.15); background: var(--agency-plum-dark); }
.app-shell .sidebar .profile strong { color: #fff; font-size: 12px; }
.app-shell .sidebar .profile small { color: #d7cde7; font-size: 10px; }
.app-shell .sidebar .profile .avatar { border: 1px solid #a69ab8; background: #c9bce3; color: #302340; }

.app-shell .main { background: var(--agency-canvas); min-width: 0; }
.app-shell .topbar {
  background: #fff; color: var(--agency-ink); border-bottom: 1px solid var(--agency-line);
  min-height: 58px; padding-inline: clamp(14px,2.1vw,30px); box-shadow: none;
}
.app-shell .breadcrumb { gap: 9px; color: var(--agency-muted); font-size: 13px; }
.app-shell .breadcrumb b { color: var(--agency-ink); font-weight: 650; }
.app-shell .topbar-actions { gap: 10px; }
.app-shell .global-search {
  background: #f8f7fa; color: var(--agency-muted); border: 1px solid transparent;
  border-radius: 6px; padding-inline: 10px; min-height: 34px;
}
.app-shell .global-search:focus-within { border-color: var(--agency-accent); background: #fff; }
.app-shell .global-search input { color: var(--agency-ink); font-size: 12px; }
.app-shell .global-search input::placeholder { color: #747182; opacity: 1; }
.app-shell .topbar-icon, .app-shell .lang-switch { color: var(--agency-muted); border-radius: 6px; }
.app-shell .topbar .avatar { border: 0; background: #e8e0f4; color: #4a386b; }
.app-shell .page { padding: clamp(16px,2vw,30px); max-width: none; }
.app-shell .page :is(h1,h2,h3,h4) { color: var(--agency-ink); letter-spacing: -.017em; }
.app-shell .page h1 { font-size: clamp(24px,2.1vw,31px); line-height: 1.3; font-weight: 700; }
.app-shell .page h2 { font-size: 19px; font-weight: 650; }
.app-shell .page h3 { font-size: 15px; font-weight: 650; }
.app-shell .page :is(.eyebrow,.page-eyebrow,.kicker) { color: var(--agency-accent-strong); font-size: 11px; font-weight: 700; }
.app-shell .page :is(.small-muted,.muted,.subtle,.panel-sub,.panel-subtitle) { color: var(--agency-muted); }
.app-shell .page :is(.page-heading,.page-header) { margin-block-end: 20px; }
.app-shell .page .stats-grid { gap: 14px; }
.app-shell .page .content-grid { gap: 18px; }
.app-shell :is(.stat-card,.panel,.project-card,.task-card,.kanban-card) {
  border: 1px solid var(--agency-line); border-radius: var(--agency-radius);
  background: #fff; box-shadow: var(--agency-shadow);
}
.app-shell .stat-card { padding: 16px; min-height: 115px; }
.app-shell .stat-card :is(.stat-value,.value) { font-size: 27px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.app-shell .stat-card :is(.stat-label,.stat-caption) { color: var(--agency-muted); font-size: 12px; }
.app-shell .panel :is(.panel-head,.panel-header) { border-bottom: 1px solid var(--agency-line); padding: 13px 16px; }
.app-shell .panel .panel-body { padding: 14px 16px; }
.app-shell .page :is(.primary-btn,.secondary-btn,.link-button,.icon-button) { border-radius: 6px; font-weight: 550; }
.app-shell .page .primary-btn, .app-shell :is(.modal,.drawer) .primary-btn {
  background: var(--agency-accent); color: #fff; border-color: var(--agency-accent);
  min-height: 34px; padding-inline: 13px; box-shadow: none; font-size: 13px;
}
.app-shell .page .primary-btn:hover, .app-shell :is(.modal,.drawer) .primary-btn:hover { background: var(--agency-accent-strong); border-color: var(--agency-accent-strong); }
.app-shell .page .secondary-btn, .app-shell :is(.modal,.drawer) .secondary-btn {
  background: #fff; color: var(--agency-ink); border-color: var(--agency-line-dark);
  min-height: 34px; padding-inline: 12px; box-shadow: none; font-size: 13px;
}
.app-shell .page .secondary-btn:hover, .app-shell :is(.modal,.drawer) .secondary-btn:hover { background: #f5f2fa; border-color: #bab1cb; }
.app-shell .page .link-button { color: var(--agency-accent-strong); }
.app-shell .page :is(button:not([disabled]),a,input,select,textarea):focus-visible,
.app-shell .sidebar :is(button:not([disabled]),a,select):focus-visible {
  outline: 2px solid #916bd1; outline-offset: 2px;
}
.app-shell .sidebar :is(button:not([disabled]),a,select):focus-visible { outline-color: #e4d9fc; }
.app-shell .page :is(.toolbar,.task-toolbar,.view-toolbar) {
  background: #fff; border-color: var(--agency-line); border-radius: 7px; box-shadow: none;
}
.app-shell .page :is(.filter-select,.filter-control) {
  min-height: 32px; font-size: 12px; border: 1px solid var(--agency-line-dark); border-radius: 6px;
  color: var(--agency-ink); background: #fff;
}
.app-shell .page :is(.view-tab,.view-button,.tab-button) { border-radius: 6px; font-size: 12px; }
.app-shell .page :is(.view-tab.active,.view-button.active,.tab-button.active) { color: var(--agency-accent-strong); background: var(--agency-violet); }
.app-shell .page :is(.table-wrap,.table-wrapper) { background: #fff; border-color: var(--agency-line); border-radius: 7px; }
.app-shell .page table { border-collapse: collapse; font-size: 12px; line-height: 1.45; }
.app-shell .page table :is(th,td) { border-color: var(--agency-line); padding: 8px 11px; text-align: start; }
.app-shell .page table th { background: #fbfafc; color: #575468; font-size: 11px; font-weight: 650; white-space: nowrap; }
.app-shell .page table td { color: #353244; font-variant-numeric: tabular-nums; }
.app-shell .page table tbody tr:hover td { background: #f9f7fc; }
.app-shell .page table :is(a,button[data-open],.task-name) { color: var(--agency-ink); }
.app-shell .page table :is(a,button[data-open],.task-name):hover { color: var(--agency-accent-strong); }
.app-shell .page :is(.task-group-heading,.task-group-head,.group-heading) { background: #f4f1f8; color: #4b3b67; }
.app-shell .page .project-card:hover { border-color: #c8bfdb; box-shadow: 0 4px 14px rgba(54,39,81,.08); }
.app-shell .page :is(.kanban-column,.board-column) { background: #f5f3f7; border-color: var(--agency-line); border-radius: 8px; }
.app-shell .page :is(.calendar-day,.calendar-cell) { border-color: var(--agency-line); background: #fff; }
.app-shell .page :is(.calendar-day.today,.calendar-cell.today) { background: #f5f0fb; }

.app-shell .pill, .agency-pill, .agency-chip, .agency-badge {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 21px;
  padding: 2px 8px; border-radius: 999px; background: #efedf3; color: #514d61;
  font-weight: 550; font-size: 11px; line-height: 1.25; white-space: nowrap; border: 0;
}
.app-shell .pill:is(.todo,.planning,.new,.waiting),
.agency-pill:is(.todo,.planning,.new,.waiting), .agency-badge:is(.neutral,.todo,.planning,.waiting) { background: #e7f0fa; color: #294a76; }
.app-shell .pill:is(.working,.active,.in_progress,.qualified,.proposal),
.agency-pill:is(.working,.active,.in_progress), .agency-badge:is(.blue,.working,.active,.in_progress) { background: #e3ecfa; color: #294e87; }
.app-shell .pill:is(.done,.complete,.won,.resolved),
.agency-pill:is(.done,.complete,.approved), .agency-badge:is(.green,.done,.complete,.approved) { background: #dceddf; color: #225d39; }
.app-shell .pill:is(.on_hold,.medium,.negotiation,.review),
.agency-pill:is(.on_hold,.review,.pending), .agency-badge:is(.amber,.review,.pending,.on_hold) { background: #fbeccf; color: #79531c; }
.app-shell .pill:is(.stuck,.urgent,.lost,.high),
.agency-pill:is(.stuck,.urgent,.overdue,.rejected), .agency-badge:is(.red,.stuck,.overdue,.rejected,.risk) { background: #f8e2e5; color: #8c2e40; }
.app-shell .pill.low,.agency-badge.low { background: #e5f1ed; color: #2c6858; }
.agency-badge:is(.purple,.violet) { background: #eee6f9; color: #603c88; }

/* Native record panels retain their accessibility and event handlers. */
:is(.modal,.drawer) { background: #fff; color: var(--agency-ink); border-radius: 9px; border-color: var(--agency-line); box-shadow: 0 14px 50px rgba(42,30,61,.19); }
:is(.modal,.drawer) :is(.modal-head,.drawer-head,.modal-header,.drawer-header) { border-color: var(--agency-line); }
:is(.modal,.drawer) h2 { color: var(--agency-ink); font-size: 22px; font-weight: 700; }
:is(.modal,.drawer) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { border-color: var(--agency-line-dark); border-radius: 6px; }
:is(.modal,.drawer) :is(input:not([type=checkbox]):not([type=radio]),select,textarea):focus { border-color: var(--agency-accent); outline: 2px solid #e4dcf4; }
:is(.modal,.drawer) .primary-btn { background: var(--agency-accent); color: #fff; border-color: var(--agency-accent); box-shadow: none; }

/* Agency pages: flexible primitives for the executive, campaign and production views. */
.agency-workspace, .agency-view, .agency-page { color: var(--agency-ink); min-width: 0; }
.agency-header, .agency-page-header, .agency-hero {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px;
  margin-block-end: 20px;
}
.agency-eyebrow, .agency-kicker { color: var(--agency-accent-strong); font-weight: 650; font-size: 11px; letter-spacing: .025em; }
.agency-title { font-size: clamp(24px,2.2vw,31px); line-height: 1.25; font-weight: 700; color: var(--agency-ink); margin: 4px 0; }
.agency-subtitle, .agency-sub, .agency-muted, .agency-secondary, .agency-caption { font-size: 12px; color: var(--agency-muted); line-height: 1.6; }
.agency-actions, .agency-controls, .agency-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agency-kpis, .agency-kpi-grid, .agency-metrics, .agency-stats {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: 14px; margin-block-end: 18px;
}
.agency-kpi, .agency-metric, .agency-stat, .agency-card, .agency-panel {
  min-width: 0; background: #fff; border: 1px solid var(--agency-line); border-radius: 8px; box-shadow: var(--agency-shadow);
}
.agency-kpi, .agency-metric, .agency-stat { position: relative; min-height: 107px; padding: 15px; }
.agency-kpi-top, .agency-metric-top, .agency-stat-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.agency-kpi-label, .agency-metric-label, .agency-stat-label { font-size: 12px; font-weight: 500; color: var(--agency-muted); }
.agency-kpi-value, .agency-metric-value, .agency-stat-value { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; letter-spacing: -.04em; line-height: 1.25; margin-block: 7px 4px; }
.agency-kpi-foot, .agency-metric-foot, .agency-stat-foot { font-size: 11px; color: var(--agency-muted); }
.agency-icon, .agency-metric-icon, .agency-kpi-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; background: #f0eaf8; color: #694b99; border-radius: 7px; flex-shrink: 0; }
.agency-icon svg, .agency-metric-icon svg, .agency-kpi-icon svg { width: 17px; height: 17px; }
.agency-grid, .agency-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(260px,1fr); gap: 16px; align-items: start; margin-block: 16px; }
.agency-grid-2, .agency-two-col, .agency-two-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.agency-panel-head, .agency-card-head, .agency-panel-header, .agency-card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 13px 16px; border-bottom: 1px solid var(--agency-line); }
.agency-section-title, .agency-panel-title, .agency-card-title { margin: 0; font-size: 14px; line-height: 1.4; color: var(--agency-ink); font-weight: 650; }
.agency-panel-body, .agency-card-body { padding: 14px 16px; }
.agency-toolbar, .agency-filters, .agency-table-toolbar { min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 13px; background: #fff; border-bottom: 1px solid var(--agency-line); }
.agency-toolbar :is(input,select), .agency-filters :is(input,select), .agency-filter {
  min-width: 0; min-height: 32px; padding: 5px 9px; color: var(--agency-ink); background: #fff;
  border: 1px solid var(--agency-line-dark); border-radius: 6px; font: inherit; font-size: 12px;
}
.agency-button, .agency-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 11px; border-radius: 6px; min-height: 33px; color: var(--agency-ink); background: #fff; border: 1px solid var(--agency-line-dark); font: inherit; font-size: 12px; font-weight: 550; text-decoration: none; cursor: pointer; }
.agency-button:hover,.agency-btn:hover { background: #f6f3fb; border-color: #c8bfdb; }
.agency-button:is(.primary,.active),.agency-btn:is(.primary,.active) { color: #fff; background: var(--agency-accent); border-color: var(--agency-accent); }
.agency-button:is(.primary,.active):hover,.agency-btn:is(.primary,.active):hover { background: var(--agency-accent-strong); }
.agency-button svg,.agency-btn svg { width: 15px; height: 15px; }
.agency-table-wrap, .agency-table-scroll, .agency-table-wrapper { overflow-x: auto; width: 100%; border-radius: 8px; background: #fff; }
.agency-table { width: 100%; border-collapse: collapse; text-align: start; font-size: 12px; line-height: 1.45; }
.agency-table th { color: #5b5767; background: #fbfafc; white-space: nowrap; font-size: 11px; font-weight: 650; }
.agency-table :is(th,td) { text-align: start; padding: 9px 11px; border-bottom: 1px solid var(--agency-line); vertical-align: middle; }
.agency-table tbody tr:last-child td { border-bottom: 0; }
.agency-table tbody tr:hover td { background: #f9f7fc; }
.agency-table button { font: inherit; }
.agency-name, .agency-record-name { font-weight: 600; color: var(--agency-ink); text-align: start; }
.agency-record-link, .agency-link { background: none; border: 0; padding: 0; text-decoration: none; color: var(--agency-accent-strong); cursor: pointer; font: inherit; text-align: start; font-weight: 600; }
.agency-record-link:hover,.agency-link:hover { text-decoration: underline; }
.agency-campaign, .agency-group-row, .agency-group-title { background: #f3eff8; color: #4f3b6f; font-weight: 650; }
.agency-row, .agency-list-row { display: flex; align-items: center; gap: 11px; justify-content: space-between; min-height: 42px; padding: 9px 0; border-bottom: 1px solid var(--agency-line); }
.agency-row:last-child,.agency-list-row:last-child { border-bottom: 0; }
.agency-avatar, .agency-avatar-sm { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; width: 27px; height: 27px; font-size: 10px; font-weight: 650; color: #543e7f; background: #e9e1f5; }
.agency-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--agency-accent); }
.agency-progress, .agency-progress-track, .agency-bar-track, .agency-track { display: block; width: 100%; height: 7px; overflow: hidden; background: #eeebf2; border-radius: 99px; }
.agency-progress :is(span,i), .agency-progress-fill, .agency-bar-fill, .agency-track :is(span,i) { display: block; height: 100%; border-radius: inherit; background: #8c76b5; }
.agency-progress-text, .agency-progress-label { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--agency-muted); }
.agency-empty, .agency-empty-state { color: var(--agency-muted); text-align: center; padding: 28px 15px; font-size: 12px; line-height: 1.6; }
.agency-empty svg, .agency-empty-state svg { margin-block-end: 8px; color: #9987ba; width: 30px; height: 30px; }
.agency-timeline, .agency-chart { min-width: 0; overflow-x: auto; }
.agency-timeline-row { display: grid; grid-template-columns: minmax(110px,1fr) minmax(180px,3fr); gap: 12px; min-height: 34px; align-items: center; border-bottom: 1px solid var(--agency-line); }
.agency-timeline-bar { min-height: 19px; border-radius: 4px; background: #a99bce; }
.agency-kanban, .agency-kanban-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(195px,1fr)); gap: 12px; }
.agency-kanban-column { min-width: 0; background: #f2f0f5; border: 1px solid var(--agency-line); padding: 10px; border-radius: 8px; }
.agency-kanban-card { background: #fff; border: 1px solid var(--agency-line); border-radius: 7px; padding: 10px; margin-block: 8px; box-shadow: var(--agency-shadow); }
.agency-client-grid, .agency-project-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 14px; }
.agency-client-card, .agency-project-card { padding: 15px; border-radius: 8px; background: #fff; border: 1px solid var(--agency-line); box-shadow: var(--agency-shadow); }

/* Agency-specific record and interface patterns. */
:is(.agency-head,.agency-page-heading) { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block-end: 19px; }
.agency-overline { color: var(--agency-accent-strong); font-size: 11px; font-weight: 650; }
.agency-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agency-badge.is-good { color: #225d39; background: #dceddf; }
.agency-badge.is-warn { color: #79531c; background: #fbeccf; }
.agency-badge.is-neutral { color: #294a76; background: #e7f0fa; }
.agency-badge.is-bad { color: #8c2e40; background: #f8e2e5; }
.agency-row-title { color: var(--agency-ink); text-align: start; font-weight: 650; }
.agency-progress-wrap { display: flex; align-items: center; gap: 9px; min-width: 105px; font-variant-numeric: tabular-nums; }
.agency-progress-wrap .agency-progress { flex: 1; min-width: 45px; }
.agency-progress-fill,.agency-bar-fill { background: #8c76b5; }
.agency-bar-row { display: grid; grid-template-columns: minmax(74px,1.1fr) minmax(50px,1.8fr) auto; align-items: center; min-height: 31px; gap: 10px; font-size: 12px; }
.agency-bar-row .agency-bar-track { height: 11px; }
.agency-avatar-name { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.agency-avatar-name .avatar { width: 25px; height: 25px; font-size: 10px; }
.agency-divider { background: var(--agency-line); border: 0; height: 1px; margin: 13px 0; }
.agency-week { color: var(--agency-muted); font-size: 11px; }
.agency-group { border-bottom: 1px solid var(--agency-line); }
.agency-group:last-child { border-bottom: 0; }
:is(.agency-group-summary,.agency-campaign,.agency-client-summary) { cursor: pointer; }
.agency-group-summary { padding: 11px 14px; background: #f5f2f8; color: #4b3b67; font-size: 13px; font-weight: 650; }
.agency-group-summary:hover { background: #f0ecf6; }
.agency-campaign { background: #f5f2f8; }
.agency-project { background: #fff; border-bottom: 1px solid var(--agency-line); padding: 9px 14px; }
.agency-project:last-child { border-bottom: 0; }
.agency-project-meta { color: var(--agency-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; }
.agency-task-list { padding-inline-start: 15px; }
.agency-task-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 37px; gap: 9px; padding: 7px 8px; border-top: 1px solid var(--agency-line); }
.agency-task-row:hover { background: #f9f7fc; }
.agency-metric-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 12px; margin-block: 14px 21px; }
.agency-metric-card { background: #fff; border: 1px solid var(--agency-line); border-radius: 8px; box-shadow: var(--agency-shadow); min-width: 0; padding: 13px; }
.agency-metric-note { color: var(--agency-muted); font-size: 11px; line-height: 1.4; }
.agency-section { min-width: 0; margin-block-end: 20px; }
.agency-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-block-end: 10px; }
.agency-section-heading h2, .agency-section-heading h3 { margin: 0; }
.agency-note { color: var(--agency-muted); font-size: 12px; line-height: 1.6; padding: 8px 0; }
.agency-review-lanes { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.agency-review-lane { background: #f0edf3; border: 1px solid var(--agency-line); min-width: 0; border-radius: 8px; padding: 10px; }
.agency-lane-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 32px; padding: 0 3px 8px; color: #514567; font-size: 12px; font-weight: 650; }
.agency-lane-count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; background: #e3ddea; color: #5d4b7e; border-radius: 5px; font-size: 10px; padding-inline: 5px; }
.agency-task-card { background: #fff; border: 1px solid var(--agency-line); box-shadow: var(--agency-shadow); border-radius: 7px; padding: 11px; margin-block-end: 8px; min-width: 0; }
.agency-card-kicker { color: var(--agency-muted); font-size: 10px; font-weight: 550; }
.agency-card-meta { color: var(--agency-muted); font-size: 11px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-block: 7px; }
.agency-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-block-start: 10px; }
.agency-review-badge,.agency-urgency,.agency-overdue { display: inline-flex; gap: 4px; align-items: center; border-radius: 99px; padding: 3px 7px; font-size: 10px; font-weight: 600; line-height: 1.15; background: #efedf3; color: #514d61; }
.agency-review-badge.review-in_review { background: #fbeccf; color: #79531c; }
.agency-review-badge.review-changes_requested,.agency-urgency,.agency-overdue { background: #f8e2e5; color: #8c2e40; }
.agency-review-badge.review-approved { background: #dceddf; color: #225d39; }
.agency-review-badge.review-draft { background: #e7f0fa; color: #294a76; }
.agency-client-list { display: grid; gap: 12px; }
.agency-client-card { padding: 0; overflow: hidden; }
.agency-client-summary { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; }
.agency-client-summary:hover { background: #f9f7fc; }
.agency-client-identity { display: flex; align-items: center; gap: 10px; }
.agency-client-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--agency-muted); }
.agency-client-content { border-top: 1px solid var(--agency-line); padding: 13px 14px; }
.agency-client-projects,.agency-client-tickets { display: grid; gap: 7px; }
.agency-client-project { border: 1px solid var(--agency-line); border-radius: 6px; padding: 10px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.agency-inline-link,.agency-link-button { background: transparent; border: 0; color: var(--agency-accent-strong); text-decoration: none; text-align: start; padding: 0; font: inherit; font-weight: 550; cursor: pointer; }
.agency-inline-link:hover,.agency-link-button:hover { text-decoration: underline; }
.agency-card-head h2,.agency-card-head h3 { font-size: 15px; line-height: 1.4; margin: 0; }
.agency-card-head p { font-size: 11px; color: var(--agency-muted); margin: 4px 0 0; line-height: 1.4; }
.agency-head p,.agency-page-heading p { margin: 5px 0 0; }
.agency-kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agency-kpi.is-bad .agency-kpi-icon { background: #fae9eb; color: #8c2e40; }
.agency-kpi.is-good .agency-kpi-icon { background: #e4f2e8; color: #225d39; }
.agency-kpi.is-warn .agency-kpi-icon { background: #fcf0d9; color: #79531c; }
.agency-bar-fill.is-good { background: #66a87b; }
.agency-bar-fill.is-bad { background: #c96879; }
.agency-bar-fill.is-blue { background: #7894ca; }
.agency-chart { padding: 14px 16px; }
.agency-grid-wide { grid-template-columns: minmax(0,2fr) minmax(245px,1fr); }
.agency-row-title,.agency-card-title:is(button) { appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer; text-decoration: none; line-height: 1.4; text-align: start; }
.agency-row-title:hover,.agency-card-title:is(button):hover { color: var(--agency-accent-strong); text-decoration: underline; }
.agency-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.agency-link svg,.agency-inline-link svg { width: 15px; height: 15px; }
.agency-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; }
.agency-empty svg { flex: 0 0 auto; margin: 0; width: 23px; height: 23px; }
.agency-group > summary,.agency-campaign > summary,.agency-project > summary { display: flex; align-items: center; gap: 11px; padding: 10px 13px; list-style: none; cursor: pointer; }
.agency-group > summary::-webkit-details-marker,.agency-campaign > summary::-webkit-details-marker,.agency-project > summary::-webkit-details-marker { display: none; }
.agency-group > summary::before,.agency-campaign > summary::before,.agency-project > summary::before { content: ''; display: block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin-inline: 2px 4px; flex: 0 0 7px; }
[dir="rtl"] :is(.agency-group,.agency-campaign,.agency-project) > summary::before { transform: rotate(135deg); }
:is(.agency-group,.agency-campaign,.agency-project)[open] > summary::before { transform: rotate(45deg); }
.agency-group > summary > span:first-of-type,.agency-campaign > summary > span:first-of-type { display: flex; gap: 7px; align-items: center; min-width: 0; flex: 1; }
.agency-group > summary svg,.agency-campaign > summary svg { width: 16px; height: 16px; flex: 0 0 16px; }
.agency-campaign { border-block-start: 1px solid var(--agency-line); background: #faf9fc; padding-inline-start: 16px; }
.agency-campaign > summary { font-size: 12px; color: #4b3b67; }
.agency-project-list { background: #fff; }
.agency-project { padding: 0; }
.agency-project > summary { display: grid; grid-template-columns: 8px 10px minmax(130px,2fr) minmax(70px,.75fr) minmax(90px,1fr) minmax(70px,.75fr) minmax(95px,1fr) auto; min-height: 49px; font-size: 12px; color: var(--agency-ink); }
.agency-project > summary:hover { background: #f9f7fc; }
.agency-project-name { font-weight: 650; min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.agency-project-name small { display: block; font-weight: 400; font-size: 10px; }
.agency-project-owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.agency-project-date { white-space: nowrap; color: var(--agency-muted); }
.agency-project-meta { background: #f9f8fc; padding: 10px 24px; gap: 12px; border-block: 1px solid var(--agency-line); }
.agency-task-list { padding: 2px 13px 9px; }
.agency-task-row { display: grid; grid-template-columns: minmax(110px,2fr) minmax(65px,.8fr) minmax(100px,1fr) minmax(70px,.75fr); gap: 9px; }
.agency-task-row > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.agency-task-row:first-child { border-top: 0; }
.agency-filter { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.agency-filter select { border: 0; font: inherit; background: transparent; color: var(--agency-ink); min-height: 22px; }
.agency-lane-cards { display: grid; gap: 8px; }
.agency-lane-cards .agency-task-card { margin: 0; }
.agency-lane-more,.agency-internal-note { color: var(--agency-muted); font-size: 11px; line-height: 1.55; padding: 8px 5px; }
.agency-internal-note { background: #f5f2f9; border: 1px solid var(--agency-line); border-radius: 6px; padding: 10px 13px; }
.agency-card-overdue { color: #8c2e40; border-color: #e5adb8; }
.agency-production-list { grid-template-columns: repeat(auto-fit,minmax(245px,1fr)); }
.agency-client-project-label { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agency-client-project-due { color: var(--agency-muted); font-size: 11px; }
.agency-client-ticket { border: 1px solid var(--agency-line); border-radius: 6px; padding: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agency-client-summary::marker { color: var(--agency-accent); }
.agency-client-summary::after { content: ''; display: block; width: 8px; height: 8px; border: solid var(--agency-accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-inline-start: 6px; flex: 0 0 8px; }
.agency-client-card[open] > .agency-client-summary::after { transform: rotate(225deg); }
.agency-client-project .agency-progress-wrap { max-width: 145px; }
.agency-timeline { padding: 11px 14px 15px; }
.agency-timeline-caption { font-size: 11px; color: var(--agency-muted); line-height: 1.5; margin-block-end: 8px; }
.agency-timeline-axis { display: grid; grid-template-columns: minmax(90px,1fr) minmax(165px,2.3fr); gap: 9px; margin-block-end: 4px; }
.agency-timeline-axis > div { min-width: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; font-size: 9px; color: var(--agency-muted); }
.agency-timeline-row { display: grid; grid-template-columns: minmax(90px,1fr) minmax(165px,2.3fr); align-items: center; gap: 9px; padding: 6px 0; min-height: 35px; }
.agency-timeline-track { position: relative; height: 20px; background: repeating-linear-gradient(to right,#f4f2f7 0%,#f4f2f7 calc(25% - 1px),#ded9e8 calc(25% - 1px),#ded9e8 25%); border: 1px solid var(--agency-line); border-radius: 4px; }
.agency-timeline-track > span { display: block; position: absolute; inset-block: 3px; min-width: 5px; background: #9d8abf; border-radius: 3px; }

@media (max-width: 1050px) {
  .agency-grid,.agency-dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .agency-kpis,.agency-kpi-grid,.agency-metrics,.agency-stats { grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); }
}
@media (max-width: 950px) {
  .agency-project > summary { grid-template-columns: 8px 10px minmax(100px,1.8fr) minmax(65px,1fr) minmax(70px,1fr) auto; }
  .agency-project > summary .agency-project-owner,.agency-project > summary .agency-project-date { display: none; }
  .agency-project-meta { padding-inline: 12px; }
}
@media (max-width: 700px) {
  .app-shell .page { padding: 14px 11px 22px; }
  .app-shell .topbar { min-height: 54px; padding-inline: 10px; }
  .app-shell .breadcrumb { font-size: 12px; gap: 5px; }
  .app-shell .page .stats-grid,.agency-kpis,.agency-kpi-grid,.agency-stats,.agency-metrics { gap: 9px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .agency-two-col,.agency-grid-2,.agency-two-column { grid-template-columns: minmax(0,1fr); }
  .agency-header,.agency-page-header,.agency-hero { align-items: flex-start; gap: 11px; margin-block-end: 15px; }
  .agency-head,.agency-page-heading { align-items: flex-start; gap: 11px; margin-block-end: 15px; }
  .agency-metric-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .agency-metric-card { padding: 10px; }
  .agency-review-lanes { grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); }
  .agency-actions,.agency-header-actions { width: 100%; }
  .agency-kpi,.agency-metric,.agency-stat { padding: 10px; min-height: 90px; }
  .agency-kpi-value,.agency-metric-value,.agency-stat-value { font-size: 22px; }
  .agency-panel-head,.agency-card-head,.agency-panel-header,.agency-card-header { padding: 11px; }
  .agency-panel-body,.agency-card-body { padding: 12px; }
  .agency-table th,.agency-table td { padding: 8px; }
  .agency-project-grid,.agency-client-grid { grid-template-columns: minmax(0,1fr); }
  .agency-toolbar > :is(input,select),.agency-filters > :is(input,select) { flex: 1 1 135px; }
  .agency-campaign { padding-inline-start: 5px; }
  .agency-project > summary { grid-template-columns: 8px 10px minmax(108px,1fr) auto; gap: 7px; }
  .agency-project > summary .agency-project-status,.agency-project > summary .agency-progress-wrap { display: none; }
  .agency-task-list { padding-inline: 8px; }
  .agency-task-row { grid-template-columns: minmax(120px,1.5fr) 1fr; gap: 5px 8px; }
  .agency-task-row > span:nth-child(3),.agency-task-row > span:nth-child(4) { font-size: 10px; }
  .agency-group > summary,.agency-campaign > summary { padding-inline: 8px; gap: 6px; }
  .agency-campaign > summary .agency-progress-wrap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell *, .agency-workspace * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
