/*
 * SuperApp SK — camada visual compartilhada
 * Mantém as regras específicas do módulo de e-mail em styles.css e melhora
 * legibilidade, ritmo, densidade e responsividade no restante do produto.
 */

:root {
  --layout-page-gap: clamp(24px, 2.4vw, 40px);
  --layout-card-radius: 18px;
  --layout-control-height: 44px;
  --layout-readable: 12px;
  --layout-shadow: 0 12px 34px rgba(25, 28, 31, .065);
}

body {
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  letter-spacing: normal;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 38%, transparent);
  outline-offset: 2px;
}

/* Estrutura e navegação */

.sidebar {
  background: linear-gradient(180deg, #202327 0%, #24272b 100%);
}

.main-nav {
  padding: 18px 12px 22px;
}

.main-nav a {
  min-height: 43px;
  margin-bottom: 3px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.25;
}

.main-nav a.active {
  background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.075));
  box-shadow: inset 3px 0 0 #d7b879;
}

.nav-label {
  margin-top: 21px;
  margin-bottom: 8px;
  font-size: 9.5px;
}

.profile-mini strong { font-size: 11.5px; }
.profile-mini small { font-size: 9.5px; }

.topbar {
  border-bottom-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 26px rgba(24, 27, 30, .035);
  backdrop-filter: blur(16px) saturate(1.15);
}

.global-search input {
  height: 44px;
  font-size: 12.5px;
}

.icon-button {
  width: 42px;
  height: 42px;
}

/* Cabeçalhos e ritmo das páginas */

.page {
  width: 100%;
  max-width: 1700px;
  padding: 34px var(--layout-page-gap) 78px;
}

.page-head {
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 23px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.page-head > div:first-child {
  min-width: 0;
}

.page-head h1 {
  margin-top: 5px;
  margin-bottom: 7px;
  font-size: clamp(32px, 3vw, 43px);
  line-height: 1.05;
}

.page-head > div:first-child > p:last-child {
  max-width: 780px;
  font-size: 13px;
  line-height: 1.55;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .145em;
}

.head-actions {
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: var(--layout-control-height);
  padding-right: 15px;
  padding-left: 15px;
  border-radius: 11px;
  font-size: 11.5px;
}

.primary-button,
.secondary-button {
  font-weight: 700;
}

.select-control,
.filter-search input,
.field input,
.field select {
  min-height: var(--layout-control-height);
  font-size: 12px;
}

.field textarea {
  font-size: 12px;
  line-height: 1.55;
}

.chip {
  padding: 5px 9px;
  font-size: 9.5px;
}

/* Cartões, painéis e áreas de trabalho */

.panel,
.contact-card,
.document-card,
.metric-panel,
.process-detail-hero {
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--layout-card-radius);
  box-shadow: var(--layout-shadow);
}

.panel-head {
  min-height: 70px;
  padding: 17px 21px;
}

.panel-head h2,
.section-title {
  font-size: 15px;
}

.panel-head p {
  font-size: 11px;
  line-height: 1.45;
}

.panel-body {
  padding: 19px 21px;
}

.panel.pad,
.metric-panel {
  padding: 23px;
}

.hero-card {
  padding: 31px 34px;
  border-radius: 21px;
  box-shadow: 0 18px 42px rgba(25, 28, 31, .11);
}

.hero-copy p { font-size: 13px; }
.hero-stat span { font-size: 11px; }

.stat-grid {
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  min-height: 140px;
  padding: 21px;
  border-radius: var(--layout-card-radius);
  box-shadow: var(--layout-shadow);
}

.stat-card strong.value { font-size: 31px; }
.stat-card > span { font-size: 11.5px; }

.content-grid,
.content-grid.equal,
.indicator-grid,
.assistant-hero {
  gap: 20px;
}

/* Tabelas e listagens densas */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.data-table th {
  padding: 12px 15px;
  font-size: 10px;
  line-height: 1.35;
}

.data-table td {
  padding: 14px 15px;
  font-size: 12px;
  line-height: 1.45;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-primary { line-height: 1.35; }
.table-secondary { font-size: 10px; line-height: 1.4; }
.row-actions { gap: 5px; }
.row-actions .icon-button { width: 34px; height: 34px; }

.process-table {
  min-width: 1180px;
}

.process-table-summary {
  font-size: 10.5px;
}

.process-owner-chip,
.process-tag-chip,
.process-row-tags .chip {
  font-size: 9px;
}

.process-responsible-button small,
.process-responsible-button em {
  font-size: 8px;
}

.process-responsible-button strong {
  font-size: 10px;
}

.process-history-menu > summary { font-size: 9px; }
.process-history-menu-list strong { font-size: 10px; }
.process-history-menu-list small { font-size: 8.5px; }

/* Processos */

.process-sync-panel {
  margin-bottom: 20px;
  padding: 24px;
}

.process-sync-head h2 { font-size: 23px; }

.process-sync-head p:not(.eyebrow) {
  font-size: 11.5px;
  line-height: 1.6;
}

.process-sync-team-box {
  margin-top: 20px;
  padding: 15px 16px;
}

.process-sync-team-summary { font-size: 10px; }
.process-sync-team-title strong { font-size: 11px; }
.process-sync-team-title small { font-size: 9px; }
.process-sync-team-count { font-size: 9px; }
.process-sync-lawyer { padding: 9px; }
.process-sync-lawyer-copy strong { font-size: 10px; }
.process-sync-lawyer-copy small { font-size: 8.5px; }
.process-sync-oabs span { font-size: 8.5px; }
.process-sync-progress small { font-size: 8.5px; }
.process-sync-progress strong { font-size: 9px; }
.process-sync-meta { font-size: 9px; line-height: 1.45; }

.process-detail-meta > span:not(.chip) { font-size: 10.5px; }
.process-detail-tabs button { min-height: 44px; font-size: 11px; }
.process-section-head h2 { font-size: 14px; }
.process-section-head p { font-size: 10.5px; }
.process-data-grid dt { font-size: 9px; }
.process-data-grid dd { font-size: 11.5px; }
.process-activity strong,
.process-history-item strong { font-size: 11px; }
.process-activity p,
.process-history-item p { font-size: 9.5px; }
.process-history-item small { font-size: 9px; }

/* Agenda */

.calendar-workspace {
  min-height: 720px;
  grid-template-columns: 220px minmax(580px, 1fr) 275px;
  border-radius: var(--layout-card-radius);
  box-shadow: var(--layout-shadow);
}

.calendar-sidebar {
  padding: 17px 17px 21px;
}

.calendar-sidebar-toggle,
.calendar-upcoming-toggle { font-size: 10px; }
.calendar-create { min-height: 46px; font-size: 12px; }
.mini-calendar > strong { font-size: 14px; }
.mini-calendar-grid > span { font-size: 9px; }
.mini-calendar-day { font-size: 10px; }
.calendar-side-section h3 { font-size: 10px; }
.calendar-side-section label { font-size: 11px; }
.calendar-toolbar { min-height: 76px; padding: 15px 19px; }
.calendar-nav h2 { min-width: 190px; font-size: 20px; }
.calendar-search { width: 150px; }
.calendar-search input { height: 36px; font-size: 10.5px; }
.weekday { padding: 11px 9px; font-size: 10px; }
.day-number { width: 27px; height: 27px; font-size: 11px; }
.calendar-event { padding: 5px 7px; font-size: 9.5px; line-height: 1.3; }
.calendar-more { font-size: 9px; }
.upcoming h2 { font-size: 14px; }
.upcoming-date { font-size: 10px; }
.time-axis span { font-size: 9px; }
.time-day-head span { font-size: 9px; }
.time-day-head strong { font-size: 12px; }
.time-event { padding: 6px 7px; }
.time-event > * { font-size: 9px; line-height: 1.35; }
.upcoming-event > span:last-child strong { font-size: 10px; }
.upcoming-event > span:last-child small { font-size: 9px; }
.upcoming-date-box strong { font-size: 14px; }
.upcoming-date-box small { font-size: 8px; }
.calendar-empty p { font-size: 10.5px; }

/* Kanban e tarefas */

.board { gap: 17px; }
.kanban-column { padding: 14px; border-radius: var(--layout-card-radius); }
.column-title { font-size: 12px; }
.column-count { font-size: 10px; }
.kanban-cards { gap: 11px; }
.kanban-card { padding: 16px; }
.card-type > span:first-child { font-size: 10px; }
.kanban-card h3 { font-size: 13px; }
.kanban-card p { font-size: 10.5px; line-height: 1.55; }
.card-meta span { font-size: 10px; }
.add-card { min-height: 40px; font-size: 11px; }
.task-copy small { font-size: 9.5px; }
.agenda-version-switch button { min-height: 38px; font-size: 10.5px; }
.todoist-card small { font-size: 10.5px; }
.todoist-sidebar h3 { font-size: 10.5px; }
.todoist-sidebar > button { min-height: 42px; font-size: 11px; }
.todoist-sidebar-note strong { font-size: 11px; }
.todoist-sidebar-note p { font-size: 9.5px; }
.todoist-task-toolbar p { font-size: 10.5px; }
.agenda-task-group > header h3 { font-size: 12.5px; }
.agenda-task-title { font-size: 12px; }
.agenda-task-meta,
.agenda-task-process { font-size: 9px; }

/* Publicações */

.publication-identity-card {
  padding: 20px;
  border-radius: 15px;
}

.publication-identity-copy h2 { font-size: 22px; }
.publication-identity-copy > p:not(.eyebrow) { font-size: 10.5px; }
.publication-visible-count { font-size: 10px; }
.publication-card-head { padding: 20px 22px; }
.publication-card-title > strong { font-size: 13px; }
.publication-treatment-actions label { font-size: 9px; }
.publication-process-link,
.publication-process-missing,
.publication-treatment-note { font-size: 10px; }
.publication-content > summary { font-size: 10px; }
.djen-result-main strong { font-size: 13px; }
.djen-result-main small { font-size: 10px; }
.djen-result-open { font-size: 10px; }
.djen-result-facts span { font-size: 10px; }
.djen-result-facts b { font-size: 9px; }
.djen-result-body > p { font-size: 11.5px; line-height: 1.72; }

/* Contatos, documentos, indicadores e assistente */

.contact-grid,
.document-grid {
  gap: 17px;
}

.contact-card,
.document-card {
  padding: 20px;
}

.contact-card h3,
.document-card h3 { font-size: 13px; }
.contact-card p,
.document-card p { font-size: 10px; }
.contact-details span { font-size: 11px; }
.doc-meta { font-size: 10px; }

.metric-panel { min-height: 310px; }
.metric-head h2 { font-size: 14px; }
.metric-head p { font-size: 10.5px; }
.donut-legend span { font-size: 10px; }
.donut-legend strong { font-size: 11px; }
.line-chart text { font-size: 10px; }

.assistant-chat { border-radius: var(--layout-card-radius); box-shadow: var(--layout-shadow); }
.chat-head h2 { font-size: 14px; }
.chat-head p { font-size: 10.5px; }
.message { font-size: 12px; }
.message small { font-size: 9px; }
.prompt-card { padding: 16px; }
.prompt-card strong { font-size: 11px; }
.prompt-card span { font-size: 10px; line-height: 1.5; }

/* Modais e estados vazios */

.modal {
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(18, 21, 24, .2);
}

.modal-head h2 { font-size: 18px; }
.field label { font-size: 10.5px; }
.empty-state h3 { font-size: 14px; }
.empty-state p { font-size: 10.5px; line-height: 1.55; }

/* Responsividade */

@media (max-width: 1280px) {
  :root { --layout-page-gap: 28px; }

  .calendar-workspace {
    grid-template-columns: 195px minmax(540px, 1fr);
  }

  .calendar-workspace > .upcoming {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  :root { --layout-page-gap: 20px; }

  .page { padding-top: 28px; }
  .page-head { align-items: flex-start; }
  .main-nav a { font-size: 12.5px; }
  .calendar-workspace { display: block; min-height: 0; }
  .calendar-sidebar,
  .calendar-workspace > .upcoming { display: none; }
}

@media (max-width: 650px) {
  :root {
    --layout-page-gap: 15px;
    --layout-control-height: 43px;
  }

  .page {
    padding-top: 23px;
    padding-bottom: 56px;
  }

  .page-head {
    gap: 17px;
    margin-bottom: 21px;
    padding-bottom: 19px;
  }

  .page-head h1 { font-size: 30px; }
  .page-head > div:first-child > p:last-child { font-size: 12px; }
  .head-actions { justify-content: stretch; }
  .head-actions > * { flex: 1 1 auto; }
  .stat-card { min-height: 126px; padding: 17px; }
  .panel.pad,
  .metric-panel { padding: 18px; }
  .panel-head { padding: 15px 17px; }
  .panel-body { padding: 16px 17px; }
  .process-sync-panel { padding: 18px; }
  .process-sync-head h2 { font-size: 21px; }
  .contact-card,
  .document-card { padding: 18px; }
}
