:root {
  --unni-brand-primary: #5613ed;
  --unni-brand-secondary: #fb0dbe;
  --unni-brand-pink: #ff25a8;
  --unni-brand-violet: #850dea;
  --unni-brand-blue: #189fe9;
  --unni-brand-cyan: #00e1ff;
  --unni-canvas: #0d0d0f;
  --unni-sidebar: #121215;
  --unni-panel: #17171a;
  --unni-card: #1c1c21;
  --unni-raised: #222227;
  --unni-hover: #2a2a30;
  --canvas: var(--unni-canvas);
  --sidebar: var(--unni-sidebar);
  --panel: var(--unni-panel);
  --card: var(--unni-card);
  --raised: var(--unni-raised);
  --hover: var(--unni-hover);
  --border-subtle: #26262c;
  --border: #2d2d34;
  --border-strong: #3d3d46;
  --text: #f4f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --primary: var(--unni-brand-primary);
  --primary-strong: var(--unni-brand-primary);
  --secondary: var(--unni-brand-secondary);
  --pink: var(--unni-brand-pink);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --focus: var(--unni-brand-blue);
  --shadow-menu: 0 12px 36px rgba(0, 0, 0, .7);
  --sidebar-width: 240px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-unni-theme="light"] {
  --unni-canvas: #f4f4f6;
  --unni-sidebar: #ffffff;
  --unni-panel: #f9f9fa;
  --unni-card: #ffffff;
  --unni-raised: #ededf0;
  --unni-hover: #e4e4e8;
  --border-subtle: #e4e4e7;
  --border: #d4d4d8;
  --border-strong: #a1a1aa;
  --text: #202024;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow-menu: 0 12px 36px rgba(24, 24, 27, .18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 0; background: var(--canvas); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, summary { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--canvas);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand picture { display: flex; width: 80px; flex: 0 0 80px; align-items: center; }
.brand-logo { width: 80px; height: auto; aspect-ratio: 962 / 391; object-fit: contain; }
.brand-logo--light { display: none; }
:root[data-unni-theme="light"] .brand-logo--dark { display: none; }
:root[data-unni-theme="light"] .brand-logo--light { display: block; }
.sidebar-brand div { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; overflow: hidden; }
.sidebar-brand strong { font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand span { color: var(--text-muted); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 22px 12px; }
.sidebar-nav p { margin: 0 8px 5px; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav a { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid transparent; border-radius: 9px; color: var(--text-secondary); font-weight: 560; }
.sidebar-nav a:hover { background: var(--card); color: var(--text); }
.sidebar-nav a.is-current { border-color: var(--border); background: var(--raised); color: var(--text); box-shadow: inset 3px 0 var(--primary); }
.sidebar-nav a span { width: 18px; color: var(--text-muted); text-align: center; }
.sidebar-nav a.is-current span { color: var(--primary); }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 12px; }
.sidebar-foot span { display: flex; align-items: center; gap: 7px; }
.sidebar-foot i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.sidebar-foot form { margin: 0; }
.sidebar-foot button { min-width: 44px; min-height: 44px; padding: 6px 9px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; }
.sidebar-foot button:hover { color: var(--danger); }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: calc(68px + env(safe-area-inset-top, 0px));
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 28px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--sidebar) 94%, transparent);
}

.topbar-context, .topbar-actions, .profile { display: flex; align-items: center; }
.topbar-context { gap: 9px; }
.mobile-brand-symbol { display: none; width: 25px; height: 25px; object-fit: contain; }
.topbar-context span, .topbar-context b { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 10px; letter-spacing: .08em; }
.topbar-context span { color: var(--text-secondary); }
.topbar-context b { border-color: color-mix(in srgb, var(--secondary) 35%, var(--border)); color: var(--pink); }
.topbar-actions { gap: 14px; }
.profile { gap: 9px; }
.profile-avatar { position: relative; display: grid; width: 38px; height: 38px; place-items: center; overflow: hidden; border: 1px solid color-mix(in srgb, var(--primary) 65%, var(--border)); border-radius: 50%; background: color-mix(in srgb, var(--primary) 20%, var(--raised)); color: var(--text); font-size: 12px; font-weight: 700; }
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-copy { display: flex; max-width: 150px; flex-direction: column; line-height: 1.25; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { color: var(--text-muted); font-size: 11px; }

.theme-control { position: relative; }
.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--raised); cursor: pointer; }
.icon-button:hover { background: var(--hover); }
.theme-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 156px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-menu); }
.theme-menu button { width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.theme-menu button:hover, .theme-menu button.is-active { background: var(--hover); }
.theme-menu button.is-active::after { float: right; color: var(--primary); content: "✓"; }

.dashboard-main { width: min(100%, 1500px); margin: 0 auto; padding: 34px 28px 56px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading > div > p:last-child { max-width: 680px; margin: 7px 0 0; color: var(--text-secondary); }
.primary-action, .secondary-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; font-weight: 700; }
.primary-action { flex: 0 0 auto; padding: 10px 17px; background: var(--primary); box-shadow: inset 0 -2px var(--secondary); color: #fff; }
.primary-action:hover { filter: brightness(1.1); }
.secondary-action { padding: 8px 12px; border: 1px solid var(--border); background: var(--raised); font-size: 12px; }
.secondary-action:hover { border-color: var(--border-strong); background: var(--hover); }
.tools-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tools-hub-card { display: grid; min-height: 112px; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.tools-hub-card:hover { border-color: var(--border-strong); background: var(--raised); transform: translateY(-1px); }
.tools-hub-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border-strong)); border-radius: 13px; background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 18%, var(--raised)), var(--panel)); color: color-mix(in srgb, var(--primary) 30%, var(--text)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 14px color-mix(in srgb, var(--primary) 10%, transparent); }
.tools-hub-icon svg { display: block; width: 25px; height: 25px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--primary) 24%, transparent)); }
.tools-hub-card:is(:hover, :focus-visible) .tools-hub-icon { border-color: color-mix(in srgb, var(--primary) 65%, var(--border-strong)); }
.tools-hub-card strong, .tools-hub-card small { display: block; }
.tools-hub-card strong { color: var(--text); font-size: 15px; }
.tools-hub-card small { margin-top: 5px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.tools-hub-arrow { color: var(--text-muted); font-size: 18px; }

.command-row { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px; margin-bottom: 20px; }
.search-control { display: flex; min-height: 46px; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text-muted); }
.search-control:focus-within { border-color: var(--primary); outline: 1px solid var(--primary); }
.search-control input { width: 100%; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-control input::placeholder { color: var(--text-muted); }
.attention-jump { display: flex; min-width: 136px; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--raised); }
.attention-jump b { color: var(--secondary); }

.load-state, .empty-state { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 160px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); text-align: left; }
.load-state strong, .empty-state strong { display: block; margin-bottom: 3px; }
.load-state p, .empty-state p { margin: 0; color: var(--text-secondary); }
.load-state--error { flex-wrap: wrap; border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); }
.state-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--danger) 14%, var(--raised)); color: var(--danger); font-weight: 800; }
.state-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.retry-button { border: 1px solid var(--border); color: var(--text); cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

.dashboard-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.dashboard-footer { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 11px; }
.dashboard-footer a { display: inline-block; min-height: 24px; padding: 4px 0; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.dashboard-footer a:hover { color: var(--text-secondary); text-decoration-color: currentColor; }
.metric-section, .attention-section, .portfolio-section { min-width: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.section-heading h2 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.section-heading.compact { align-items: center; }
.text-button { min-height: 44px; padding: 7px 2px; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 650; }
.count-badge, .neutral-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.count-badge { border: 1px solid color-mix(in srgb, var(--secondary) 35%, transparent); background: color-mix(in srgb, var(--secondary) 13%, transparent); color: var(--pink); }
.neutral-badge { border: 1px solid var(--border); background: var(--raised); color: var(--text-secondary); }

.metric-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.metric-card { min-width: 0; min-height: 92px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.metric-card-head, .metric-summary { display: flex; align-items: center; }
.metric-card-head { justify-content: space-between; gap: 8px; }
.metric-card-head i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--text-muted); }
.metric-card--success .metric-card-head i { background: var(--success); }
.metric-card--warning .metric-card-head i { background: var(--warning); }
.metric-card--brand .metric-card-head i { background: var(--primary); }
.metric-card--danger .metric-card-head i { background: var(--danger); }
.metric-label { overflow: hidden; color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .035em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.metric-summary { flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-top: 13px; }
.metric-value { font-variant-numeric: tabular-nums; font-size: 24px; line-height: 1; }
.metric-caption { color: var(--text-secondary); font-size: 9px; }

.attention-section { padding: 18px; border: 1px solid var(--border); border-top: 2px solid transparent; border-radius: 14px; background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(90deg, var(--danger), var(--warning), var(--primary)) border-box; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.attention-grid > .empty-state { grid-column: 1 / -1; }
.attention-card { display: flex; min-width: 0; min-height: 204px; flex-direction: column; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.attention-card--high { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.attention-card--medium { border-color: color-mix(in srgb, var(--warning) 38%, var(--border)); }
.attention-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.attention-card h3 { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.3; }
.attention-kicker { color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.urgency-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; background: var(--raised); color: var(--text-secondary); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.attention-card--high .urgency-badge { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.attention-card--medium .urgency-badge { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.attention-headline { margin-top: 18px; font-size: 13px; }
.attention-card > p { margin: 7px 0 16px; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.attention-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 10px; }

.portfolio-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.portfolio-head, .portfolio-row { display: grid; grid-template-columns: minmax(180px, 1.15fr) minmax(110px, .8fr) minmax(150px, 1fr) minmax(96px, .55fr); gap: 14px; }
.portfolio-head { min-height: 36px; align-items: center; padding: 0 15px; border-bottom: 1px solid var(--border); background: var(--sidebar); color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.portfolio-row { min-height: 92px; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--border-subtle); }
.portfolio-row:last-child { border-bottom: 0; }
.portfolio-row:hover { background: var(--card); }
.client-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.client-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--primary) 13%, var(--raised)); font-size: 11px; font-weight: 800; }
.client-identity h3 { margin: 2px 0; overflow-wrap: anywhere; font-size: 13px; }
.client-identity p { margin: 0; color: var(--text-muted); font-size: 11px; }
.portfolio-cell { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.portfolio-cell strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.portfolio-cell small { color: var(--text-muted); font-size: 10px; }
.cell-label { display: none; color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.status { display: inline-flex; width: fit-content; align-items: center; color: var(--text-secondary); }
.status::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--text-muted); content: ""; }
.status--revisão::before { background: var(--primary); }
.status--aprovação::before { background: var(--warning); }
.status--publicado::before { background: var(--success); }
.row-link { display: inline-flex; width: fit-content; min-height: 44px; align-items: center; color: var(--primary); font-size: 10px; font-weight: 700; }
.portfolio-list > .empty-state { margin: 14px; }

.bottom-nav { display: none; }

.next-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--text-muted); font-size: 11px; }
.next-breadcrumb a { min-height: 32px; display: inline-flex; align-items: center; }
.next-breadcrumb a:hover { color: var(--text); }
.heading-count { display: inline-flex; min-height: 24px; align-items: center; margin-left: 8px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-size: 10px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }
.clients-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(150px, auto)); gap: 10px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.filter-control { display: flex; min-width: 0; min-height: 46px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--raised); }
.filter-control span { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.filter-control select { min-width: 0; flex: 1; height: 44px; border: 0; outline: 0; background: var(--raised); color: var(--text); cursor: pointer; }
.filter-control:focus-within { border-color: var(--primary); outline: 1px solid var(--primary); }
.clients-content { display: grid; gap: 18px; }
.clients-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.clients-metrics .metric-card { display: grid; align-content: space-between; }
.clients-result-head { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-secondary); }
.clients-list { display: grid; gap: 8px; }
.clients-list > .empty-state { min-height: 220px; }
.client-directory-card { display: grid; grid-template-columns: minmax(200px, 1.25fr) minmax(0, .65fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, .85fr) minmax(104px, auto); gap: 14px; align-items: center; min-width: 0; min-height: 100px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.client-directory-card:hover { background: var(--card); }
.client-directory-card.has-pending { border-left: 3px solid var(--secondary); }
.client-directory-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.client-directory-title { display: flex; min-width: 0; align-items: center; gap: 7px; }
.client-directory-title h2 { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.client-directory-identity p { margin: 4px 0 0; color: var(--text-muted); font-size: 10px; overflow-wrap: anywhere; }
.code-badge { display: inline-flex; width: fit-content; padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-secondary); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.directory-cell { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.directory-cell strong { overflow-wrap: anywhere; font-size: 11px; }
.directory-cell small { color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
.pending-copy { color: var(--pink); }
.directory-action { min-width: 104px; }

.deterministic-back { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--text-secondary); font-weight: 650; }
.deterministic-back:hover { color: var(--text); }
.client-360-content { display: grid; gap: 18px; }
.client-out-of-panel-warning { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 18px; border: 1px solid color-mix(in srgb, var(--danger) 58%, var(--border)); border-left: 4px solid var(--danger); border-radius: 14px; background: color-mix(in srgb, var(--danger) 12%, var(--panel)); box-shadow: 0 14px 34px color-mix(in srgb, var(--danger) 9%, transparent); }
.client-out-of-panel-warning[hidden] { display: none; }
.client-out-of-panel-warning > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--danger) 18%, var(--raised)); color: var(--danger); font-size: 20px; font-weight: 850; }
.client-out-of-panel-warning .eyebrow { color: var(--danger); }
.client-out-of-panel-warning h2 { margin: 3px 0 7px; font-size: 19px; }
.client-out-of-panel-warning strong { display: block; font-size: 13px; }
.client-out-of-panel-warning p:last-child { margin: 5px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.client-hero { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: 15px; background: var(--panel); }
.client-avatar--large { width: 58px; height: 58px; flex-basis: 58px; border-radius: 14px; font-size: 18px; }
.client-hero-copy { min-width: 0; flex: 1 1 auto; }
.client-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.client-title-line h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.client-hero-copy > p { margin: 7px 0 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.client-hero-actions { display: flex; flex: 0 1 330px; justify-content: flex-end; }
.client-hero-actions form { width: 100%; }
.client-view-action { width: 100%; border: 0; cursor: pointer; background: linear-gradient(100deg, var(--primary), var(--secondary)); box-shadow: none; }
.client-view-action small { margin-left: auto; padding: 3px 6px; border-radius: 4px; background: rgba(13, 13, 15, .5); font-size: 8px; letter-spacing: .05em; }
.client-view-unavailable { max-width: 260px; margin: 0; color: var(--text-muted); font-size: 11px; text-align: right; }
.client-section-nav { display: flex; gap: 5px; overflow-x: auto; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); scrollbar-width: thin; }
.client-section-nav a { display: inline-flex; min-width: max-content; min-height: 44px; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.client-section-nav a:hover, .client-section-nav a:focus-visible { background: var(--raised); color: var(--text); }
.client-overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 18px; align-items: stretch; }
.client-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 10px; }
.summary-card { display: flex; min-width: 0; min-height: 94px; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.summary-card span { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.summary-card strong { overflow-wrap: anywhere; font-size: 13px; }
.client-360-section { scroll-margin-top: 84px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.client-360-section--priority { border-left: 3px solid var(--secondary); }
.context-list, .service-grid { display: grid; gap: 9px; }
.context-card, .service-card { padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.context-card--high { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); }
.context-card--medium { border-color: color-mix(in srgb, var(--warning) 38%, var(--border)); }
.context-card h3, .service-card h3 { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.context-card > p { margin: 8px 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.context-card > small { color: var(--text-muted); }
.context-kicker { color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.agency-followup { margin-top: 12px; padding: 10px; border-left: 2px solid var(--primary); background: var(--raised); }
.agency-followup strong { font-size: 11px; }
.agency-followup p { margin: 4px 0 0; color: var(--text-secondary); font-size: 11px; }
.service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-dates { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 13px 0 0; }
.service-dates dt { color: var(--text-muted); font-size: 10px; }
.service-dates dd { margin: 0; text-align: right; font-size: 10px; }
.client-context-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.client-context-columns > div { min-width: 0; }
.client-context-columns h3 { margin: 0 0 9px; font-size: 12px; }
[data-client-materials], [data-client-approvals] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-client-materials] > .empty-state, [data-client-approvals] > .empty-state { grid-column: 1 / -1; }
.agency-material-workspace { display: grid; gap: 14px; }
.agency-material-panel { min-width: 0; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--card); }
.agency-material-panel-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.agency-material-panel-head > div { display: flex; min-width: 0; align-items: center; gap: 9px; }
.agency-material-panel-head > div > span { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: 8px; color: var(--accent); font-size: 10px; font-weight: 800; }
.agency-material-panel-head h3 { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.agency-material-panel-head > p { max-width: 390px; margin: 0; color: var(--text-muted); font-size: 10px; text-align: right; }
.agency-material-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.agency-material-form[hidden], .agency-social-fields[hidden], .agency-delete-modal[hidden], [data-no-contracted-service][hidden] { display: none; }
.agency-material-field { display: grid; min-width: 0; gap: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 750; }
.agency-material-field > span { overflow-wrap: anywhere; }
.agency-material-field select, .agency-material-field input, .agency-material-field textarea { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); color: var(--text); font: inherit; font-size: 12px; }
.agency-material-field textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
.agency-social-fields { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(180px, .6fr) minmax(0, 1.4fr); gap: 8px 12px; }
.agency-social-fields > .agency-material-field:last-child { grid-column: 1 / -1; }
.agency-selected-files { display: grid; grid-column: 1 / -1; gap: 4px; max-height: 360px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.agency-selected-files li { overflow-wrap: anywhere; padding: 6px 8px; border-radius: 7px; background: var(--raised); color: var(--text-secondary); font-size: 10px; }
.agency-selected-files .agency-upload-item { display: grid; min-width: 0; gap: 3px; padding: 6px 8px; border: 1px solid var(--border); }
.agency-upload-filename { min-width: 0; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 11px; }
.agency-file-progress { display: block; width: 100%; min-width: 0; height: 5px; border: 0; border-radius: 999px; overflow: hidden; appearance: none; background: var(--border); accent-color: var(--primary); }
.agency-file-progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.agency-file-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), var(--pink)); border-radius: 999px; }
.agency-file-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--primary), var(--pink)); border-radius: 999px; }
.agency-upload-state { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.agency-upload-item[data-state="success"] .agency-upload-state { color: var(--success); }
.agency-upload-item[data-state="error"] .agency-upload-state { color: var(--danger); }
.agency-upload-item[data-state="cancelled"] .agency-upload-state { color: var(--text-secondary); }
.agency-material-form [data-agency-upload-cancel] { min-height: 44px; }
.agency-material-form [data-agency-upload-cancel][hidden] { display: none; }
.agency-material-feedback { grid-column: 1 / -1; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--raised); color: var(--text-secondary); font-size: 11px; }
.agency-material-feedback[hidden] { display: none; }
.agency-material-feedback[data-type="success"] { border-color: color-mix(in srgb, var(--success) 38%, var(--border)); color: var(--success); }
.agency-material-feedback[data-type="error"] { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); color: var(--danger); }
.agency-material-submit { grid-column: 1 / -1; justify-self: end; border: 0; cursor: pointer; }
.agency-material-submit:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .5; }
.agency-publication-list, .agency-publication-media { display: grid; gap: 10px; }
.agency-publication-list:not(:empty) { margin-bottom: 12px; }
.agency-publication-card { min-width: 0; padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: 11px; background: var(--panel); }
.agency-publication-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agency-publication-head h4 { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 14px; }
.publication-status { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-size: 9px; font-weight: 750; }
.publication-status--aprovado { border-color: color-mix(in srgb, var(--success) 38%, var(--border)); color: var(--success); }
.publication-status--revisao { border-color: color-mix(in srgb, var(--warning) 42%, var(--border)); color: var(--warning); }
.publication-status--reprovado { border-color: color-mix(in srgb, var(--danger) 42%, var(--border)); color: var(--danger); }
.agency-caption-label { display: block; margin-top: 14px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.agency-publication-caption { margin: 6px 0 14px; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.material-context-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: auto; padding: 0 8px 10px; }
.material-context-actions > :only-child { grid-column: 1 / -1; }
.material-context-actions:empty { display: none; }
.material-context-actions > .material-view-action, .material-context-actions > .danger-link { width: 100%; min-width: 0; min-height: 44px; padding: 8px 3px; font-size: 11px; box-sizing: border-box; }
.material-context-actions .material-view-action { margin: 0; }
.danger-link, .danger-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); border-radius: 9px; background: color-mix(in srgb, var(--danger) 9%, var(--raised)); color: var(--danger); cursor: pointer; font: inherit; font-size: 11px; font-weight: 750; }
.danger-link:hover, .danger-action:hover { background: color-mix(in srgb, var(--danger) 16%, var(--raised)); }
.danger-action:disabled { cursor: not-allowed; opacity: .45; }
.agency-delete-modal { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: rgba(0, 0, 0, .72); }
.agency-delete-dialog { width: min(100%, 520px); max-height: calc(100vh - 36px); overflow-y: auto; box-sizing: border-box; padding: 22px; border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--border)); border-radius: 14px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.agency-delete-dialog h2 { margin: 5px 0 10px; font-size: 20px; }
.agency-delete-dialog > p:not(.eyebrow) { color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.agency-delete-filename { display: block; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 8px; background: var(--raised); font-size: 12px; }
.agency-delete-dialog .agency-delete-instruction { display: block; margin: 8px 0; color: var(--text); font-size: 15px; line-height: 1.55; font-weight: 650; }
.agency-delete-dialog .agency-delete-instruction strong { color: var(--danger); font-weight: 850; }
.agency-delete-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.client-briefing-card { display: grid; min-width: 0; gap: 16px; padding: 20px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--card); }
.client-briefing-copy { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.client-briefing-title { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.client-briefing-company { margin: 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.client-briefing-metadata { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.client-briefing-progress { display: flex; min-width: 0; height: 12px; border-radius: 6px; background: var(--border); }
.client-briefing-segment { position: relative; flex-basis: 0; min-width: 0; }
.client-briefing-segment.has-boundary::after { content: ''; position: absolute; right: 0; top: -3px; bottom: -3px; border-right: 2px solid var(--text); }
.client-briefing-segment-fill { display: block; width: 100%; height: 12px; border: 0; appearance: none; background: transparent; accent-color: var(--primary); }
.client-briefing-segment-fill::-webkit-progress-bar { background: transparent; }
.client-briefing-segment-fill::-webkit-progress-value { background: var(--primary); }
.client-briefing-segment-fill::-moz-progress-bar { background: var(--primary); }
.client-briefing-segment.is-priority .client-briefing-segment-fill::-webkit-progress-value { background: var(--secondary); }
.client-briefing-segment.is-priority .client-briefing-segment-fill::-moz-progress-bar { background: var(--secondary); }
.client-briefing-segment.is-complete { outline: 1px solid var(--secondary); outline-offset: 2px; }
.client-briefing-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.client-briefing-actions { display: flex; justify-content: flex-end; }
.client-briefing-actions .secondary-action { min-height: 44px; white-space: normal; text-align: center; }
.compact-context-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--card); }
.compact-context-row strong { overflow-wrap: anywhere; font-size: 11px; }
.compact-context-row span { flex: 0 0 auto; color: var(--text-muted); font-size: 9px; }
.material-context-row { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0; padding: 0; }
.material-card-preview { position: relative; display: grid; width: 100%; min-width: 0; aspect-ratio: 4 / 3; flex: 0 0 auto; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border-subtle); border-radius: 8px 8px 0 0; background: var(--raised); }
.material-card-preview img { position: absolute; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.material-card-preview--pdf { background: linear-gradient(145deg, color-mix(in srgb, var(--danger) 10%, var(--raised)), var(--raised)); }
.material-file-type { display: grid; width: 42px; height: 48px; place-items: center; border: 1px solid var(--border); border-radius: 7px; color: var(--text-secondary); background: var(--card); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.material-card-preview--pdf .material-file-type { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }
.material-context-copy { display: flex; min-width: 0; justify-content: center; flex-direction: column; gap: 5px; padding: 10px; }
.material-context-copy strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.5; }
.material-context-copy span { flex: initial; overflow-wrap: anywhere; }
.material-view-action { min-width: 92px; align-self: center; flex: 0 0 auto; margin-right: 12px; }
.agency-materials-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.agency-materials-grid > .empty-state { grid-column: 1 / -1; }
.agency-publication-media { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) {
  .agency-materials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .agency-materials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agency-publication-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .agency-materials-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .agency-publication-media { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .agency-materials-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.contact-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.contact-grid dt, .contact-grid dd { min-height: 48px; margin: 0; padding: 13px; border-bottom: 1px solid var(--border-subtle); }
.contact-grid dt { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.contact-grid dd { overflow-wrap: anywhere; font-size: 12px; }
.contact-grid dt:last-of-type, .contact-grid dd:last-of-type { border-bottom: 0; }
.empty-state--compact { min-height: 92px; }
.empty-contact { grid-column: 1 / -1; padding: 18px; color: var(--text-muted); }

@media (max-width: 1199px) {
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .clients-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .attention-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clients-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clients-toolbar .search-control { grid-column: 1 / -1; }
  .client-directory-card { grid-template-columns: minmax(180px, 1.25fr) repeat(2, minmax(0, .75fr)) minmax(104px, auto); }
  .client-directory-identity { grid-column: 1 / 3; }
  .client-directory-card .directory-cell:nth-of-type(3) { grid-column: 1 / 3; }
  .directory-action { grid-column: 4; }
  .client-overview-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023px) {
  .app-sidebar { display: none; }
  .app-shell { padding-left: 0; }
  .dashboard-main { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: flex;
    min-height: calc(62px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    justify-content: space-around;
    padding: 0 max(5px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(5px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--border);
    background: var(--sidebar);
  }
  .bottom-nav > a, .bottom-nav summary { display: flex; min-width: 72px; min-height: 62px; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; color: var(--text-secondary); font-size: 10px; list-style: none; cursor: pointer; }
  .bottom-nav > a span, .bottom-nav summary span { font-size: 18px; line-height: 1; }
  .bottom-nav > a.is-current { color: var(--primary); }
  .more-menu { position: relative; display: flex; flex: 1; }
  .more-menu summary::-webkit-details-marker { display: none; }
  .more-menu > div { position: absolute; right: 5px; bottom: calc(100% + 9px); width: min(270px, calc(100vw - 24px)); padding: 7px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-menu); }
  .more-menu > div a { display: flex; min-height: 44px; align-items: center; padding: 9px 11px; border-radius: 7px; font-size: 13px; }
  .more-menu > div a:hover { background: var(--hover); }
  .more-menu-note { margin: 0; padding: 11px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
}

@media (max-width: 767px) {
  .topbar { position: relative; min-height: calc(56px + env(safe-area-inset-top, 0px)); padding: calc(8px + env(safe-area-inset-top, 0px)) max(13px, env(safe-area-inset-right, 0px)) 8px max(13px, env(safe-area-inset-left, 0px)); }
  .topbar-context span { display: none; }
  .mobile-brand-symbol { display: block; order: 1; }
  .topbar-context::before { order: 2; }
  .topbar-context b { order: 3; }
  .topbar-context::before { color: var(--text); content: "UNNI Next"; font-size: 14px; font-weight: 750; }
  .profile-copy { display: none; }
  .profile-avatar { width: 36px; height: 36px; }
  .icon-button { width: 44px; height: 44px; border: 0; background: var(--raised); }
  .dashboard-main { padding: 19px max(13px, env(safe-area-inset-right, 0px)) calc(86px + env(safe-area-inset-bottom, 0px)) max(13px, env(safe-area-inset-left, 0px)); }
  .page-heading { display: block; margin-bottom: 14px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading > div > p:last-child { margin-top: 3px; font-size: 12px; }
  .page-heading .eyebrow { display: none; }
  .primary-action { width: 100%; min-height: 46px; margin-top: 15px; }
  .tools-hub-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tools-hub-card { min-height: 96px; padding: 14px; }
  .command-row { grid-template-columns: minmax(0, 1.2fr) minmax(118px, .8fr); gap: 8px; margin-bottom: 18px; }
  .search-control { min-width: 0; min-height: 44px; }
  .search-control input { font-size: 16px; }
  .search-control input::placeholder { color: transparent; }
  .attention-jump { min-width: 0; min-height: 44px; padding: 0 9px; font-size: 12px; }
  .dashboard-content { gap: 24px; }
  .dashboard-footer { margin-top: 24px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { font-size: 16px; }
  .section-heading .eyebrow { display: none; }
  .section-heading.compact { align-items: flex-end; }
  .text-button { max-width: 160px; padding: 4px 0; text-align: right; line-height: 1.25; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 94px; padding: 12px; }
  .metric-value { font-size: 24px; }
  .attention-section { padding: 0; border: 0; background: transparent; }
  .attention-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .attention-card { min-height: 0; padding: 13px; }
  .attention-headline { margin-top: 13px; }
  .attention-card > p { margin-bottom: 13px; }
  .attention-meta { flex-wrap: wrap; }
  .attention-meta .secondary-action { width: 100%; min-height: 44px; }
  .portfolio-panel { overflow: visible; border: 0; background: transparent; }
  .portfolio-head { display: none; }
  .portfolio-list { display: grid; gap: 8px; }
  .portfolio-row { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 13px 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  .portfolio-row:last-child { border-bottom: 1px solid var(--border); }
  .client-identity { grid-column: 1 / -1; }
  .client-identity .cell-label { display: none; }
  .client-avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .client-identity h3 { font-size: 14px; }
  .portfolio-cell { padding-top: 10px; border-top: 1px solid var(--border-subtle); }
  .portfolio-cell:nth-child(3) { grid-column: 1 / -1; }
  .portfolio-delivery { align-items: flex-end; }
  .cell-label { display: block; }
  .portfolio-list > .empty-state { margin: 0; }
  .load-state, .empty-state { min-height: 136px; padding: 20px 16px; }
  .next-breadcrumb { display: none; }
  .heading-count { margin-left: 4px; }
  .clients-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; border: 0; background: transparent; }
  .clients-toolbar .search-control { grid-column: 1 / -1; }
  .filter-control { min-height: 44px; }
  .filter-control:nth-of-type(3) { grid-column: 1 / -1; }
  .filter-control span { display: none; }
  .clients-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .clients-result-head { min-height: 38px; }
  .client-directory-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
  .client-directory-identity { grid-column: 1 / -1; }
  .client-directory-card .directory-cell { display: flex; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
  .client-directory-card .directory-cell:nth-of-type(2), .client-directory-card .directory-cell:nth-of-type(3) { grid-column: 1 / -1; }
  .directory-action { grid-column: 1 / -1; width: 100%; }
  .client-directory-title { flex-wrap: wrap; }
  .deterministic-back { margin-bottom: 6px; }
  .client-hero { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  .client-avatar--large { width: 48px; height: 48px; flex-basis: 48px; font-size: 15px; }
  .client-title-line h1 { font-size: 22px; }
  .client-hero-copy > p { font-size: 11px; }
  .client-hero-actions { flex: 1 0 100%; }
  .client-view-unavailable { max-width: none; text-align: left; }
  .client-section-nav { margin-right: calc(-1 * max(13px, env(safe-area-inset-right, 0px))); margin-left: calc(-1 * max(13px, env(safe-area-inset-left, 0px))); padding-right: max(13px, env(safe-area-inset-right, 0px)); padding-left: max(13px, env(safe-area-inset-left, 0px)); border-right: 0; border-left: 0; border-radius: 0; }
  .client-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-card { min-height: 88px; padding: 12px; }
  .client-360-section { scroll-margin-top: 12px; padding: 14px; }
  .service-grid, .client-context-columns { grid-template-columns: minmax(0, 1fr); }
  .agency-material-form, .agency-social-fields { grid-template-columns: minmax(0, 1fr); }
  .agency-material-panel-head, .agency-publication-head { align-items: stretch; flex-direction: column; }
  .agency-material-panel-head > p { max-width: none; text-align: left; }
  .agency-material-submit { width: 100%; justify-self: stretch; }
  [data-client-materials], [data-client-approvals] { grid-template-columns: minmax(0, 1fr); }
  .compact-context-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .compact-context-row span { flex: initial; }
  .material-context-row { align-items: stretch; gap: 0; }
  .agency-delete-actions { flex-direction: column-reverse; }
  .agency-delete-actions > * { width: 100%; box-sizing: border-box; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-grid dt { min-height: 0; padding-bottom: 3px; border-bottom: 0; }
  .contact-grid dd { padding-top: 3px; }
}

/* Prévia Next do cliente: experiência somente leitura dentro do Dashboard. */
.dashboard-footer-identification { color: var(--text-muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.client-preview-page { overflow-x: hidden; background: var(--canvas); }
.client-preview-shell { width: min(100%, 1280px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 0 28px 40px; }
.client-preview-topbar { display: grid; min-height: calc(78px + env(safe-area-inset-top, 0px)); grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--border); }
.client-preview-topbar picture { display: flex; align-items: center; }
.client-preview-topbar img { width: 128px; max-height: 34px; object-fit: contain; }
.client-preview-topbar > .secondary-action { justify-self: end; }
.client-preview-mode { display: flex; align-items: center; gap: 8px; }
.client-preview-mode strong, .client-preview-mode span { padding: 5px 9px; border-radius: 999px; font-size: 9px; letter-spacing: .07em; }
.client-preview-mode strong { border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border)); color: #d8b4fe; }
.client-preview-mode span { background: color-mix(in srgb, var(--pink) 14%, var(--card)); color: #f0abfc; }
.client-preview-content { display: grid; gap: 18px; padding-top: 28px; }
.client-preview-hero { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(22px, 4vw, 48px); border: 1px solid var(--border); border-radius: 20px; background: radial-gradient(circle at 84% 8%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 34%), linear-gradient(145deg, var(--panel), var(--card)); }
.client-preview-hero h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 52px); letter-spacing: -.04em; }
.client-preview-hero p { margin: 0; color: var(--text-secondary); }
.client-preview-status { flex: 0 0 auto; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--success) 45%, var(--border)); border-radius: 999px; color: var(--success); font-size: 11px; font-weight: 750; }
.client-preview-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.client-preview-summary { display: flex; min-height: 92px; flex-direction: column; justify-content: space-between; gap: 9px; padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); }
.client-preview-summary span { color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.client-preview-summary strong { overflow-wrap: anywhere; font-size: 15px; }
.client-preview-section { padding: clamp(18px, 3vw, 28px); border: 1px solid var(--border); border-radius: 17px; background: var(--panel); }
.client-preview-grid, .client-preview-materials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.client-preview-card { min-width: 0; min-height: 128px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.client-preview-card h3 { margin: 7px 0; overflow-wrap: anywhere; font-size: 14px; }
.client-preview-card p, .client-preview-card small { margin: 0; color: var(--text-secondary); font-size: 11px; }
.client-preview-material { display: flex; min-width: 0; min-height: 84px; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.client-preview-material > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.client-preview-material strong { overflow-wrap: anywhere; font-size: 12px; }
.client-preview-material .primary-action { flex: 0 0 auto; }
.client-preview-empty { grid-column: 1 / -1; margin: 0; padding: 24px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted); text-align: center; }
.client-preview-footer { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 4px; color: var(--text-muted); font-size: 10px; }
.client-preview-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--text-secondary); font-weight: 750; }

/* Autenticação visual Next reutilizando os contratos de segurança existentes. */
.next-auth-page { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--primary) 18%, transparent), transparent 34%), var(--canvas); }
.next-auth-shell { display: grid; width: min(100%, 560px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; align-content: center; gap: 22px; padding: 28px; }
.next-auth-brand { display: flex; justify-content: center; }
.next-auth-brand img { width: 150px; max-height: 42px; object-fit: contain; }
.next-auth-card { padding: clamp(22px, 5vw, 38px); border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: 0 28px 80px rgba(0,0,0,.34); }
.next-auth-card h1 { margin: 9px 0; font-size: clamp(25px, 5vw, 34px); }
.next-auth-card > p { color: var(--text-secondary); }
.next-auth-message { padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--danger) 9%, var(--card)); color: var(--danger) !important; }
.next-auth-message--success { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); background: color-mix(in srgb, var(--success) 9%, var(--card)); color: var(--success) !important; }
.next-auth-form { display: grid; gap: 10px; margin-top: 22px; }
.next-auth-form label { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.next-auth-form input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.next-auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent); }
.next-auth-form button { min-height: 48px; margin-top: 8px; border: 0; border-radius: 10px; background: linear-gradient(105deg, var(--primary), var(--pink)); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.next-otp-group { display: grid; min-width: 0; gap: 10px; }
.next-otp-group > span { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.next-otp-digits { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, 1vw, 8px); }
.next-auth-form .next-otp-digits input { min-width: 0; padding: 8px 0; text-align: center; font-size: 22px; font-weight: 700; aspect-ratio: 1; }
.next-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; }
.next-auth-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--text-secondary); font-size: 11px; font-weight: 700; }

@media (max-width: 900px) {
  .client-preview-shell { padding: 0 18px 32px; }
  .client-preview-topbar { grid-template-columns: 1fr auto; }
  .client-preview-mode { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-bottom: 12px; }
  .client-preview-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-preview-materials { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .client-preview-shell { padding: 0 13px 24px; }
  .client-preview-topbar { min-height: 72px; }
  .client-preview-topbar img { width: 104px; }
  .client-preview-topbar > .secondary-action { min-height: 44px; padding: 9px 11px; font-size: 10px; }
  .client-preview-hero { align-items: flex-start; flex-direction: column; }
  .client-preview-overview, .client-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .client-preview-material { align-items: stretch; flex-direction: column; }
  .client-preview-material .primary-action { width: 100%; min-height: 46px; }
  .client-preview-footer { align-items: flex-start; flex-direction: column; padding-top: 8px; }
  .next-auth-shell { padding: 18px 13px; }
}

@media (max-width: 359px) {
  .attention-jump span:not([aria-hidden]) { display: none; }
  .portfolio-row { grid-template-columns: minmax(0, 1fr); }
  .portfolio-delivery { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Novo cliente: formulário nativo da experiência Dashboard Next. */
.client-create-main { width: min(100%, 1180px); }
.client-create-heading { align-items: center; }
.client-create-heading > div, .create-section-head > div { min-width: 0; }
.client-create-heading p, .create-section-head p, .create-inline-note { overflow-wrap: anywhere; }
.create-mode-badge { display: inline-flex; min-height: 30px; flex: 0 0 auto; align-items: center; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--text-secondary); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.client-create-form { display: grid; min-width: 0; gap: 14px; }
.create-section { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 15px; background: var(--panel); }
.create-section > * { max-width: 100%; }
.create-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.create-section-head > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 1px solid color-mix(in srgb, var(--primary) 44%, var(--border)); border-radius: 9px; background: color-mix(in srgb, var(--primary) 12%, var(--raised)); color: var(--primary); font-size: 10px; font-weight: 800; }
.create-section-head h2 { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.02em; }
.create-section-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; }
.create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.create-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: var(--text-secondary); font-size: 11px; font-weight: 650; }
.create-field--wide { grid-column: 1 / -1; }
.create-field > span { display: block; }
.create-field > span b { color: var(--pink); }
.create-field input, .create-field select, .create-field textarea { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: var(--card); color: var(--text); font-size: 16px; font-weight: 450; }
.create-field input, .create-field select { min-height: 46px; padding: 10px 12px; }
.create-field textarea { min-height: 104px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.create-field input::placeholder, .create-field textarea::placeholder { color: var(--text-muted); opacity: 1; }
.create-field input:hover, .create-field select:hover, .create-field textarea:hover { border-color: var(--border-strong); }
.create-field input:focus, .create-field select:focus, .create-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent); }
.create-field input:disabled, .create-field select:disabled, .create-field textarea:disabled { cursor: not-allowed; opacity: .55; }
.create-field input[readonly] { background: var(--raised); color: var(--text-secondary); }
.create-field small { color: var(--text-muted); font-size: 10px; font-weight: 500; }
.create-inline-note { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--primary); background: var(--card); color: var(--text-secondary); font-size: 11px; }
.create-subsection { min-width: 0; margin: 18px 0 0; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--card); }
fieldset.create-subsection { border: 1px solid var(--border-subtle); }
.create-subsection legend, .create-subsection h3 { margin: 0 0 13px; padding: 0; color: var(--text); font-size: 12px; font-weight: 750; }
.create-subsection legend { padding-right: 7px; padding-left: 7px; }
.create-field-status { min-height: 18px; margin: 10px 0 0; color: var(--text-muted); font-size: 10px; }
.create-field-status[data-type="success"] { color: var(--success); }
.create-field-status[data-type="error"] { color: var(--danger); }
.create-field-status[data-type="loading"] { color: var(--primary); }
.create-consent { display: flex; min-height: 68px; align-items: flex-start; gap: 11px; margin-top: 18px; padding: 14px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 7%, var(--card)); cursor: pointer; }
.create-consent input, .create-service-toggle input, .create-check-grid input { width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0; accent-color: var(--primary); }
.create-consent span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.create-consent strong { font-size: 12px; }
.create-consent small { color: var(--text-secondary); font-size: 10px; line-height: 1.5; }
.service-select-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--text-muted); font-size: 10px; }
.service-select-summary strong { color: var(--text-secondary); text-transform: uppercase; }
.create-service-list { display: grid; gap: 8px; }
.create-service { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.create-service.is-selected { border-color: color-mix(in srgb, var(--primary) 52%, var(--border)); }
.create-service-toggle { display: flex; min-height: 58px; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; }
.create-service-toggle span { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
.create-service-toggle strong { overflow-wrap: anywhere; font-size: 12px; }
.create-service-toggle small { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 9px; }
.create-service-toggle:has(input:disabled) { cursor: not-allowed; opacity: .48; }
.create-service-details { padding: 15px; border-top: 1px solid var(--border-subtle); background: color-mix(in srgb, var(--raised) 55%, var(--card)); }
.create-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.create-totals > div { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; min-height: 66px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--raised); }
.create-totals span { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.create-totals strong { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.create-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.create-check-grid label { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); cursor: pointer; }
.create-check-grid span { overflow-wrap: anywhere; font-size: 11px; }
.create-submit-panel { position: sticky; bottom: 12px; z-index: 10; padding: 12px; border: 1px solid var(--border-strong); border-radius: 14px; background: color-mix(in srgb, var(--sidebar) 94%, transparent); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.create-submit-panel > div { display: flex; justify-content: flex-end; gap: 9px; }
.create-submit-panel .primary-action, .create-submit-panel .secondary-action { min-height: 46px; border: 0; cursor: pointer; font-size: 12px; }
.create-submit-panel .secondary-action { border: 1px solid var(--border); }
.create-submit-panel .primary-action:disabled { cursor: wait; filter: none; opacity: .65; }
.create-submit-message { margin: 0 0 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); border-radius: 9px; background: color-mix(in srgb, var(--danger) 10%, var(--card)); color: var(--danger); font-size: 11px; }
.create-submit-message[data-type="success"] { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); background: color-mix(in srgb, var(--success) 10%, var(--card)); color: var(--success); }

@media (min-width: 768px) and (max-width: 1023px) {
  .create-submit-panel { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 767px) {
  .client-create-main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .client-create-heading .create-mode-badge { margin-top: 10px; }
  .create-section { padding: 15px; border-radius: 13px; }
  .create-section-head { margin-bottom: 15px; }
  .create-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .create-field--wide { grid-column: auto; }
  .create-subsection { padding: 13px; }
  .service-select-summary { align-items: flex-start; flex-direction: column; }
  .create-service-toggle { min-height: 60px; padding: 12px; }
  .create-service-toggle span { align-items: flex-start; flex-direction: column; gap: 3px; }
  .create-service-details { padding: 12px; }
  .create-totals, .create-check-grid { grid-template-columns: minmax(0, 1fr); }
  .create-submit-panel { position: static; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .create-submit-panel > div { flex-direction: column-reverse; }
  .create-submit-panel .primary-action, .create-submit-panel .secondary-action { width: 100%; min-height: 48px; margin-top: 0; }
}

/* Canonical material sections reuse the approved responsive grids. */
.client-360-main [data-agency-deliverable-sections] { display: grid; gap: 20px; min-width: 0; }


/* Compact Social packages only; ordinary deliverable grids retain their layout. */
.client-360-main .agency-publication-list {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.client-360-main .agency-publication-card { display: flex; flex-direction: column; padding: 12px; }
.client-360-main .agency-publication-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.client-360-main .agency-publication-head h4 { font-size: 12px; }
.client-360-main .agency-publication-card .publication-status { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.client-360-main .agency-publication-card .agency-caption-label { margin-top: 10px; }
.client-360-main .agency-publication-caption {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 5px 0 0;
}
.client-360-main .agency-publication-caption.is-expanded { display: block; -webkit-line-clamp: unset; }
.client-360-main .agency-caption-toggle {
  display: block;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.client-360-main .agency-caption-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.client-360-main .agency-platform-badge { padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.client-360-main .agency-platform-badge--instagram { color: var(--text); border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: color-mix(in srgb, var(--primary) 10%, var(--panel)); }
.client-360-main .agency-platform-badge--facebook { color: var(--text); background: var(--raised); }
.client-360-main .agency-publication-date { margin: 8px 0 12px; color: var(--text-muted); font-size: 11px; }
.client-360-main .agency-publication-media { height: 240px; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 116px; gap: 8px; background: var(--canvas); border-radius: 8px; }
.client-360-main .agency-publication-media[data-media-count="1"] { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 240px; }
.client-360-main .agency-publication-media[data-media-count="2"] { grid-auto-rows: 240px; }
.client-360-main .agency-publication-media[data-media-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 240px; }
.client-360-main .agency-publication-media[data-media-count="0"] { display: none; }
.client-360-main .agency-publication-tile { position: relative; min-width: 0; }
.client-360-main .agency-publication-preview { display: block; height: 100%; min-width: 0; }
.client-360-main .agency-publication-preview .material-card-preview { height: 100%; aspect-ratio: auto; border: 0; border-radius: 6px; background: var(--canvas); }
.client-360-main .agency-media-more { position: absolute; right: 6px; bottom: 6px; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.client-360-main .agency-publication-footer { display: grid; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.client-360-main .agency-publication-count { color: var(--text-muted); font-size: 10px; }
.client-360-main .agency-publication-select { min-width: 0; width: 100%; min-height: 44px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--panel); font: inherit; font-size: 11px; }
.client-360-main .agency-publication-actions .material-context-actions { padding: 0; }
.client-360-main .agency-publication-tile[hidden], .client-360-main .agency-caption-toggle[hidden], .client-360-main .agency-media-more[hidden] { display: none; }
.client-360-main .agency-publication-preview:focus-visible, .client-360-main .agency-media-more:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (min-width: 768px) {
  .client-360-main .agency-publication-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .client-360-main .agency-publication-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Agency publishing form: compact rows without changing canonical card grids. */
.client-360-main .agency-material-form { align-items: start; row-gap: 8px; column-gap: 12px; }
.client-360-main .agency-material-field { align-content: start; gap: 4px; }
.client-360-main .agency-material-field select,
.client-360-main .agency-material-field input:not([type="file"]) { height: 44px; min-height: 44px; box-sizing: border-box; padding: 8px 10px; font-size: 12px; border-radius: 8px; }
.client-360-main .agency-social-fields { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; column-gap: 12px; }
.client-360-main [data-social-caption] { height: 104px; min-height: 104px; box-sizing: border-box; padding: 8px 10px; font-size: 12px; line-height: 1.45; border-radius: 8px; }
.client-360-main .is-social-publication .agency-material-field:has([data-agency-files]) { grid-column: 1 / -1; }
.client-360-main [data-agency-files] { height: 44px; min-height: 44px; box-sizing: border-box; padding: 4px 6px; font-size: 11px; border-radius: 8px; }
.client-360-main [data-agency-files]::file-selector-button { min-height: 32px; height: 32px; margin: 0 8px 0 0; padding: 0 10px; border-radius: 6px; font-size: 11px; }
.client-360-main .agency-selected-files { gap: 4px; margin: 2px 0 0; }
.client-360-main .agency-selected-files:empty { display: none; }
.client-360-main .agency-selected-files .agency-upload-item { gap: 3px; padding: 6px 8px; border-radius: 8px; }
.client-360-main .agency-upload-filename { line-height: 15px; font-size: 11px; }
.client-360-main .agency-file-progress { height: 5px; }
.client-360-main .agency-upload-state { line-height: 14px; font-size: 10px; }
.client-360-main .agency-material-feedback { box-sizing: border-box; min-height: 38px; padding: 8px 10px; margin: 0 0 6px; }
@media (max-width: 767px) {
  .client-360-main .agency-social-fields { grid-template-columns: minmax(0, 1fr); }
  .client-360-main [data-social-caption] { height: 108px; min-height: 108px; }
}

/* Ephemeral canonical creation signal. Inset mask never changes layout or hit targets. */
@property --agency-created-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.client-360-main [data-created-item-id] { position: relative; scroll-margin-top: 96px; }
.client-360-main .is-agency-created-highlight { animation: agency-created-glow 5000ms ease-out both; animation-delay: var(--agency-created-delay, 0ms); }
.client-360-main .is-agency-created-highlight::after {
  content: ''; position: absolute; inset: 0; padding: 2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--agency-created-angle), transparent 0% 50%, #818cf8cc 58%, #7c3aedee 68%, #db2777ee 78%, #f472b6ee 84%, #fb923ccc 89%, #38bdf8cc 94%, #818cf8cc 98%, transparent);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: agency-created-runner 1800ms linear infinite, agency-created-fade 5000ms ease-out both;
  animation-delay: var(--agency-created-delay, 0ms);
}
@keyframes agency-created-runner { to { --agency-created-angle: 360deg; } }
@keyframes agency-created-fade { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes agency-created-glow { 0%, 82% { box-shadow: 0 0 16px rgba(124, 58, 237, 0.4), 0 0 6px rgba(219, 39, 119, 0.28); } 100% { box-shadow: 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) {
  .client-360-main .is-agency-created-highlight { animation: none; box-shadow: 0 0 12px rgba(124, 58, 237, 0.35); }
  .client-360-main .is-agency-created-highlight::after { animation: none; }
}

/* ==========================================================================
   Master Tools: Estilos Unificados para Ferramentas no Dashboard Next
   ========================================================================== */
.tools-main {
  width: min(100%, 1180px);
}

.tools-main .deterministic-back {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.tools-main .deterministic-back:hover {
  color: var(--text);
}

.tool-section {
  min-width: 0;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.tool-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.tool-section-head > div {
  min-width: 0;
}
.tool-section-head h2, .tool-section-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.tool-section-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.tool-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.tool-metric {
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--card);
}
.tool-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tool-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.tool-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.tool-alert--success {
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  background: color-mix(in srgb, var(--success) 12%, var(--card));
  color: var(--success);
}
.tool-alert--error {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--card));
  color: var(--danger);
}
.tool-alert--info {
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
  color: var(--text);
}

.tool-form {
  display: grid;
  gap: 14px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tool-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tool-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}
.tool-field--wide {
  grid-column: 1 / -1;
}
.tool-field label, .tool-field > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}
.tool-field input, .tool-field select, .tool-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: 0;
  box-sizing: border-box;
}
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.tool-field input[readonly], .tool-field input:disabled {
  background: var(--raised);
  color: var(--text-muted);
  cursor: not-allowed;
}
.tool-field small, .tool-field-hint {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.tool-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.tool-password-wrap input {
  padding-right: 44px;
}
.tool-password-toggle {
  position: absolute;
  right: 2px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}
.tool-password-toggle:hover {
  color: var(--text);
}

.tool-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.tool-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.tool-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  box-sizing: border-box;
}
.tool-btn--primary {
  background: var(--primary);
  color: #ffffff;
}
.tool-btn--primary:hover {
  filter: brightness(1.1);
}
.tool-btn--secondary {
  border-color: var(--border);
  background: var(--raised);
  color: var(--text);
}
.tool-btn--secondary:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}
.tool-btn--danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 15%, var(--card));
  color: var(--danger);
}
.tool-btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 25%, var(--card));
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-user-list {
  display: grid;
  gap: 10px;
}
.tool-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--card);
}
.tool-user-info {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.tool-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 20%, var(--raised));
  color: var(--text);
  font-weight: 750;
  font-size: 13px;
  overflow: hidden;
}
.tool-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tool-user-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.tool-user-meta strong {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-user-meta span {
  color: var(--text-secondary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tool-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tool-badge--active {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
}
.tool-badge--blocked {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
}
.tool-badge--role {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}
.tool-badge--pending {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
}

.tool-qr-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--card);
}
.tool-qr-canvas {
  width: 180px;
  height: 180px;
  flex: 0 0 180px;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  box-sizing: border-box;
}
.tool-qr-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.tool-secret-code {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--raised);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  user-select: all;
}

.tool-recovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.tool-recovery-code {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .08em;
  user-select: all;
}

.tool-profile-editor {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--card);
  margin-bottom: 16px;
}
.tool-profile-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--raised);
  border: 2px solid var(--border);
  overflow: hidden;
  font-size: 1.25rem;
  font-weight: 750;
}
.tool-profile-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-avatar-select {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}
.tool-avatar-select input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 100px;
}

.crop-dialog {
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-menu);
  overflow: auto;
}
.crop-dialog::backdrop {
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(8px);
}
.crop-shell {
  padding: 20px;
}
.crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.crop-head h3 {
  margin: 0;
  font-size: 16px;
}
.crop-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}
.crop-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}
.crop-close:hover {
  background: var(--hover);
  color: var(--text);
}
.crop-stage-wrap {
  display: grid;
  place-items: center;
  margin-top: 14px;
}
.crop-stage {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #090915;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}
.crop-guide {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.crop-controls {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.crop-controls label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.crop-controls input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 16px;
}
.crop-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 11px;
  text-align: center;
}
.crop-help {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.avatar-processing {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}
.avatar-processing.is-visible { display: flex; }
.avatar-processing::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--success) 30%, transparent);
  border-top-color: var(--success);
  border-radius: 50%;
  animation: avatar-spin .75s linear infinite;
}
@keyframes avatar-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
  .tools-main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .tool-section {
    padding: 16px;
    border-radius: 13px;
  }
  .tool-section-head {
    flex-direction: column;
    gap: 8px;
  }
  .tool-grid, .tool-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-user-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .tool-user-card .tool-btn {
    width: 100%;
  }
  .tool-profile-editor {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
  .tool-profile-preview {
    width: 72px;
    height: 72px;
  }
  .tool-qr-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .tool-actions {
    flex-direction: column;
  }
  .tool-actions .tool-btn {
    width: 100%;
  }
  .crop-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .crop-actions .tool-btn:first-child {
    order: 2;
  }
}
