/**
 * styles.css — OfficeLaw Frontend
 * Versão: V1.0
 * Shell operacional alinhado ao contrato visual V2.0.
 */

/* =========================================================================
   Reset e base
   ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --color-primary: #1a1a2e;
  --color-primary-hover: #16213e;
  --color-accent: #e94560;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* =========================================================================
   V0.148: Seção de Deploy / Atualizações do Sistema
   ========================================================================= */

.section-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.section-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 6px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

/* Grade de cards de status */
.deploy-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.status-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.status-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

/* Barra de progresso */
.progress-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.progress-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-info), var(--color-accent));
  border-radius: 99px;
  transition: width 0.4s ease;
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Blocos de ação */
.deploy-action-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.action-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}

.action-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}

/* Área de upload */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area.dragover {
  border-color: var(--color-info);
  background: #eff6ff;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-muted);
}

.upload-label:hover {
  color: var(--color-info);
}

.file-info {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 500;
  padding: 8px 12px;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  border: 1px solid #bbf7d0;
}

/* Botões */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-warning {
  background: var(--color-warning);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-warning:hover { background: #d97706; }
.btn-warning:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover { background: #dc2626; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover { background: #f1f5f9; border-color: #94a3b8; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Lista de backups */
.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: background 0.1s;
}

.backup-item:hover { background: var(--color-bg); }

.backup-item--latest {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.backup-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backup-name {
  font-size: 13px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: var(--color-text);
}

.backup-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.badge--green {
  background: #dcfce7;
  color: #166534;
}

/* Estado vazio */
.empty-state {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 16px;
  margin: 0;
}

/* Animação slide-in para toasts */
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =========================================================================
   OfficeLaw V1.0 — base estrutural e contrato visual V2.0
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--text); }
body, button, input, select, textarea { font-family: var(--font-sans); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2 { color: var(--text-strong); letter-spacing: -0.025em; }
h1 { font-family: var(--font-editorial); font-weight: 600; }
h2, h3, h4 { font-weight: 600; }
code, pre, .mono { font-family: var(--font-mono); }
::selection { background: var(--accent-soft); color: var(--text-strong); }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted, .dim { color: var(--muted); }
.eyebrow, .field-label, .dlabel, .status-label {
  color: var(--muted-2); font-family: var(--font-mono); font-size: 10px;
  font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
}
.feedback { min-height: 0; color: var(--muted); }
.feedback:empty { display: none; }
.word-wrap-anywhere { overflow-wrap: anywhere; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.runtime-banner {
  position: fixed; inset: 0 0 auto; z-index: 1000; padding: 9px 18px;
  border-bottom: 1px solid var(--warning); background: var(--warning-soft);
  color: var(--warning); font: 500 11px/1.4 var(--font-mono); text-align: center; pointer-events: none;
}

.panel, .card, .nested-panel, .section-shell, .section-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--text); box-shadow: none;
}
.panel, .card, .nested-panel, .section-shell { padding: 20px; }
.nested-panel { background: var(--panel-muted); border-radius: var(--radius-md); }
.accent-card { border-color: var(--accent-ring); background: var(--accent-soft); }
.critical-surface { border-color: rgba(248,113,113,.35); background: var(--danger-soft); }
.section-title {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid var(--line);
  color: var(--text);
}
.section-title h2, .section-title h3 { margin: 0 0 4px; color: var(--text-strong); }
.section-title h2 { font: 600 28px/1.05 var(--font-editorial); }
.section-title h3 { font-size: 16px; }
.section-actions, .form-actions, .filter-actions, .action-bar, .batch-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}

button, .btn {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 15px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: #1b160d; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
button:hover, .btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .secondary, .btn-secondary {
  background: transparent; border-color: var(--line-strong); color: var(--text);
}
button.secondary:hover, .secondary:hover, .btn-secondary:hover {
  background: var(--panel-hover); border-color: var(--muted-3); color: var(--text-strong);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1b160d; }
.btn-lg { min-height: 46px; padding-inline: 22px; }
.danger, .b-danger { color: var(--danger); }
.b-success, .tone-success { color: var(--success); }
.b-warning, .tone-warning { color: var(--warning); }

label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text);
  font-size: 13px; transition: border-color .15s ease, background .15s ease;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--muted-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--panel-muted);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form input { min-width: 280px; }
.inline-select { width: auto; min-width: 150px; }
.form-hint { color: var(--muted-2); font-size: 11px; }

.layout-two, .cards, .compact-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.workspace-edition {
  border-left: 3px solid var(--accent, #c7682c);
}
.workspace-edition-public {
  border-left-color: var(--info, #476987);
}
.workspace-edition .section-title h2 {
  max-width: 760px;
  font-size: 1.05rem;
  font-weight: 500;
}
.workspace-edition .compact-cards {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.workspace-edition .compact-cards .card {
  min-height: 92px;
  padding: 14px;
  box-shadow: none;
}
.workspace-edition details {
  margin-top: 14px;
}
.workspace-edition li + li {
  margin-top: 6px;
}
.layout-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.layout-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 18px; }
.full { grid-column: 1 / -1; }
.list, .list-clean, .compact-list, .ticket-thread, .dra-law-message-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list-item, .ticket-list-item, .ticket-message, .dra-law-message {
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-muted);
}
.list-item.clickable:hover, .ticket-list-item:hover { border-color: var(--accent-ring); background: var(--panel-hover); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag, .legal-badge, .login-panel-chip, .login-stage-badge, .dra-law-review-chip {
  display: inline-flex; align-items: center; width: fit-content; min-height: 22px; padding: 3px 9px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-muted);
  color: var(--muted); font: 500 10px/1 var(--font-mono); letter-spacing: .04em;
}
.tag-neutral { color: var(--muted); }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--muted-3); }
.dot-success { background: var(--success); }

table, .legal-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { color: var(--muted-2); font: 500 10px/1.3 var(--font-mono); letter-spacing: .08em; text-align: left; text-transform: uppercase; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover { background: var(--panel-hover); }
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.pagination button { min-width: 32px; min-height: 32px; padding: 0 8px; }
.pagination .is-current { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }

/* Acesso público */
.login-shell { min-height: 100vh; padding: 24px clamp(20px, 4vw, 64px) 56px; background: var(--bg); }
.shell-utility-bar {
  max-width: 1440px; margin: 0 auto 28px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px;
}
.login-back-link { min-height: 34px; }
.theme-control { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.theme-control select { width: auto; min-height: 34px; padding-block: 6px; }
.login-layout {
  width: min(1440px, 100%); margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, .72fr); gap: clamp(22px, 3vw, 46px);
  align-items: start;
}
.login-hero-panel { min-height: 680px; padding: clamp(28px, 4vw, 58px); background: var(--panel-muted); overflow: hidden; }
.login-hero-topline { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.login-hero-panel h1 { max-width: 760px; margin: 16px 0 20px; font-size: clamp(42px, 5vw, 72px); line-height: .98; }
.login-hero-lead { max-width: 760px; font-size: 15px; line-height: 1.75; }
.login-stage-badge { border-color: var(--accent-ring); color: var(--accent); white-space: nowrap; }
.login-hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 38px 0 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.login-signal-panel { min-height: 168px; padding: 22px; background: var(--panel); border-right: 1px solid var(--line); }
.login-signal-panel:last-child { border-right: 0; }
.login-signal-panel.emphasis { background: var(--accent-soft); }
.login-signal-panel strong { display: block; margin: 12px 0 8px; color: var(--text-strong); font-size: 14px; }
.login-signal-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-signal-kicker { color: var(--accent); font: 500 9px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.login-evidence-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-block: 1px solid var(--line); }
.login-evidence-strip > div { padding: 16px; border-right: 1px solid var(--line); }
.login-evidence-strip > div:last-child { border-right: 0; }
.login-evidence-strip span { display: block; color: var(--muted-2); font: 500 9px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.login-evidence-strip strong { display: block; margin-top: 8px; color: var(--text-strong); font-size: 13px; }
.login-command-board { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.login-command-board header { display: grid; gap: 8px; margin-bottom: 12px; }
.login-command-list { list-style: none; margin: 0; padding: 0; }
.login-command-list li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
.login-command-list strong { color: var(--text); font-weight: 600; text-align: right; }
.login-stack { display: grid; gap: 14px; }
.login-panel, .login-support-panel { padding: clamp(24px, 3vw, 36px); }
.login-panel h2 { margin: 8px 0 6px; font: 600 32px/1.05 var(--font-editorial); }
.login-panel-head { align-items: flex-start; }
.login-panel-chip { color: var(--accent); border-color: var(--accent-ring); }
.login-panel label + label, .login-panel label + .password-strength-shell { margin-top: 15px; }
.login-panel button[type="submit"] { width: 100%; margin-top: 18px; }
.login-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.password-strength-shell { display: grid; gap: 6px; }
.password-strength-bar { height: 3px; overflow: hidden; border-radius: 99px; background: var(--line-strong); }
.password-strength-bar span { display: block; width: 35%; height: 100%; background: var(--accent); }

/* Shells operacionais */
.app-shell, .owner-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); background: var(--bg); }
.sidebar, .owner-sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column;
  gap: 26px; padding: 26px 18px 20px; border-right: 1px solid var(--line); background: var(--sidebar);
}
.sidebar h2, .owner-sidebar h2 { margin: 0; color: var(--text-strong); font: 600 27px/1 var(--font-editorial); }
#org-chip, #owner-org-chip { margin: 8px 0 0; font: 400 10px/1.4 var(--font-mono); }
.nav, .owner-nav { display: grid; gap: 3px; overflow-y: auto; }
.nav button, .owner-nav button {
  min-height: 39px; justify-content: flex-start; padding: 0 12px; border-color: transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; font-weight: 500;
}
.nav button:hover, .owner-nav button:hover { background: var(--panel-hover); border-color: transparent; color: var(--text); }
.nav button.is-current, .nav button.active, .owner-nav button.is-current, .owner-nav button.active {
  background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent);
}
#logout-button, #owner-logout-button { margin-top: auto; }
.content, .owner-content { min-width: 0; padding: 20px clamp(20px, 3vw, 44px) 54px; }
.topbar, .owner-topbar {
  position: sticky; top: 0; z-index: 20; min-height: 78px; margin: 0 0 22px; padding: 15px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-radius: var(--radius-md); background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(14px);
}
.topbar h1, .owner-topbar h1 { margin: 0 0 3px; font: 600 30px/1 var(--font-editorial); }
.topbar p, .owner-topbar p { margin: 0; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.shell-workspace-button .workspace-context-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  line-height: 1.15;
}
.shell-workspace-button .workspace-context-label {
  overflow: visible;
  color: var(--muted);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.shell-workspace-button #shell-workspace-name {
  display: block;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#view-root, #owner-view-root { display: grid; gap: 18px; }
.owner-gate-list { display: grid; gap: 7px; padding: 0; list-style: none; }

/* Assistente contextual */
.dra-law-button { position: fixed; right: 24px; bottom: 22px; z-index: 55; box-shadow: var(--shadow-medium); }
.dra-law-panel {
  position: fixed; inset: 0 0 0 auto; z-index: 50; width: min(480px, 100vw); padding: 24px;
  border-left: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-medium);
  transform: translateX(100%); transition: transform .2s ease; overflow-y: auto;
}
.dra-law-panel[aria-hidden="false"] { transform: translateX(0); }
.dra-law-shell, .dra-law-workspace { display: grid; gap: 14px; }
.dra-law-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dra-law-body { display: grid; gap: 12px; }
.dra-law-message.user { margin-left: 36px; border-color: var(--accent-ring); background: var(--accent-soft); }
.dra-law-message.ai { margin-right: 36px; }
.dra-law-sidebar, .dra-law-context-card, .dra-law-composer-card, .dra-law-overview-card,
.dra-law-commercial-card, .dra-law-process-card, .dra-law-welcome, .dra-law-workspace-radar {
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-muted);
}
.dra-law-document-launchpad {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 34px);
  border-top: 3px solid var(--accent);
  background: var(--panel);
}
.dra-law-launch-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.dra-law-launch-heading h2 { margin: 7px 0 8px; font-size: clamp(25px, 3vw, 36px); }
.dra-law-launch-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.dra-law-launch-heading > button { min-height: 42px; flex: 0 0 auto; }
.dra-law-launch-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.dra-law-launch-card {
  min-height: 126px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}
.dra-law-launch-card.is-primary { border-color: var(--accent-ring); background: var(--accent-soft); }
.dra-law-launch-card h3 { margin: 1px 0 7px; font-size: 17px; }
.dra-law-launch-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.dra-law-launch-step {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-strong);
  font: 600 10px/1 var(--font-mono);
}
.dra-law-record-picker { border-top: 1px solid var(--line); padding-top: 22px; }
.dra-law-record-picker > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}
.dra-law-record-picker > header strong { display: block; margin-top: 6px; font-size: 15px; }
.dra-law-record-list { display: grid; gap: 8px; }
.dra-law-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}
.dra-law-record-main { min-width: 0; }
.dra-law-record-main > strong { display: block; color: var(--text-strong); font-size: 13px; }
.dra-law-record-main > span {
  display: block;
  margin: 4px 0 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dra-law-record-actions { display: flex; align-items: center; gap: 8px; }
.dra-law-record-actions button { min-height: 40px; white-space: nowrap; }
.dra-law-strategy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dra-law-legal-research { margin-top: 18px; border-left: 3px solid var(--accent); }
.dra-law-legal-research details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.dra-law-legal-research summary { cursor: pointer; color: var(--text-strong); font-weight: 650; }
.dra-law-research-form { display: grid; gap: 12px; margin-top: 12px; }
.dra-law-legal-research blockquote { margin: 10px 0; padding: 10px 14px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.dra-law-search { display: flex; gap: 8px; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 1px; overflow-x: auto; background: var(--line); border: 1px solid var(--line); }
.calendar-day { min-height: 110px; padding: 10px; background: var(--panel); }
.document-viewer, .code-block { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-muted); }
.document-viewer { min-height: 360px; padding: 18px; }
.document-engine-pages {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  padding-bottom: 8px;
  overflow-x: auto;
}

.document-engine-firewall {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}
.document-page-button { flex: 0 0 auto; }
.document-engine-text {
  min-height: 280px;
  max-height: 560px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: 400 13px/1.65 var(--font-body);
}
.code-block { padding: 14px; font: 11px/1.6 var(--font-mono); }
.qr-preview { max-width: 180px; padding: 12px; background: #fff; border-radius: var(--radius-sm); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.checkbox-card, .checkbox-field, .ticket-checkbox-row { display: flex; align-items: flex-start; gap: 9px; }
.checkbox-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-muted); }
.tickets-layout { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 16px; }

@media (max-width: 1100px) {
  .login-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
  .login-hero-panel { min-height: 0; padding: 34px; }
  .login-hero-panel h1 { font-size: 48px; }
  .login-hero-grid { grid-template-columns: 1fr; }
  .login-signal-panel { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-signal-panel:last-child { border-bottom: 0; }
  .topbar, .owner-topbar { align-items: flex-start; }
  .topbar-actions { align-items: stretch; flex-direction: column-reverse; }
  .layout-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-hero-panel { min-height: auto; }
  .app-shell, .owner-shell { width: 100%; grid-template-columns: minmax(0, 1fr); }
  .sidebar, .owner-sidebar {
    position: relative; width: 100%; min-width: 0; max-width: 100%; height: auto; padding: 16px 18px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden;
  }
  .nav, .owner-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .nav button, .owner-nav button { flex: 0 0 auto; }
  #logout-button, #owner-logout-button { position: absolute; top: 14px; right: 18px; min-height: 34px; }
  .content, .owner-content { width: 100%; min-width: 0; max-width: 100%; padding: 16px 18px 46px; overflow: hidden; }
  #view-root, #owner-view-root, #view-root > *, #owner-view-root > *, .panel, .card { min-width: 0; max-width: 100%; }
  .topbar, .owner-topbar { position: relative; top: auto; }
  .layout-split, .tickets-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .login-shell { padding: 14px 14px 36px; }
  .shell-utility-bar { align-items: flex-start; margin-bottom: 16px; }
  .login-back-link { max-width: 58%; text-align: left; }
  .login-hero-panel { padding: 24px; }
  .login-hero-panel h1 { font-size: 38px; }
  .login-hero-topline { display: block; }
  .login-stage-badge { margin-top: 14px; }
  .login-evidence-strip { grid-template-columns: 1fr; }
  .login-evidence-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .login-evidence-strip > div:last-child { border-bottom: 0; }
  .login-command-list li { display: grid; }
  .login-command-list strong { text-align: left; }
  .login-actions-row, .layout-two, .layout-three, .cards, .compact-grid, .detail-grid,
  .dra-law-strategy-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .topbar, .owner-topbar { display: grid; }
  .topbar-actions { width: 100%; }
  .inline-form { width: 100%; }
  .inline-form input { min-width: 0; }
  .theme-control-inline { display: none; }
  .section-title { display: grid; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(72px, 1fr)); }
  .dra-law-button { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Rodada 15 — caixa de revisão de movimentações */
.movement-review-console { overflow: hidden; }
.movement-health-ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 20px 0; border: 1px solid var(--line); }
.movement-health-ledger > div { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--line); }
.movement-health-ledger > div:last-child { border-right: 0; }
.movement-health-ledger span, .movement-health-ledger small { display: block; color: var(--muted-2); font-size: 9px; }
.movement-health-ledger strong { display: block; margin: 5px 0; color: var(--text-strong); font: 500 21px var(--font-mono); }
.compact-title { margin-top: 26px; }
.movement-review-list { border: 1px solid var(--line); }
.movement-review-row { display: grid; grid-template-columns: 34px minmax(260px, 1.7fr) minmax(150px, .7fr) minmax(150px, .7fr); gap: 18px; align-items: center; min-height: 88px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.movement-review-row:last-child { border-bottom: 0; }
.movement-review-row[data-review-status="REJECTED"] { opacity: .7; }
.movement-select { display: grid; place-items: center; }
.movement-primary { min-width: 0; }
.movement-primary strong, .movement-primary span, .movement-primary small, .movement-action-summary span, .movement-action-summary small { display: block; }
.movement-primary strong { color: var(--text-strong); font-size: 12px; }
.movement-primary span { margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movement-primary small, .movement-action-summary small { margin-top: 5px; color: var(--muted-2); font-size: 8px; }
.movement-status { display: flex; flex-wrap: wrap; gap: 5px; }
.movement-action-summary span { color: var(--accent); font: 500 9px var(--font-mono); }
.movement-followup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-top: 0; background: var(--panel-muted); }
.movement-reconcile-form, .movement-suggestion-form, .portal-job-replay-form { display: grid; gap: 8px; }
.movement-reconcile-form { grid-template-columns: 1.2fr .8fr 1.2fr auto; }
.movement-suggestion-form { grid-template-columns: .7fr 1fr .9fr 1.2fr auto; }
.movement-deadline-fields:not([hidden]) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.movement-deadline-fields label { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: 12px; }
.movement-deadline-fields small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }
.review-batch-actions { display: grid; grid-template-columns: 220px minmax(280px, 1fr) auto; gap: 10px; margin-top: 12px; }
.movement-replay-list { display: grid; gap: 8px; }
.portal-job-replay-form { grid-template-columns: minmax(180px, .7fr) minmax(280px, 1fr) auto; align-items: center; padding: 12px 14px; border: 1px solid var(--line); }
.portal-job-replay-form span strong, .portal-job-replay-form span small { display: block; }
.portal-job-replay-form span small { color: var(--danger); font-size: 8px; }

@media (max-width: 1100px) {
  .movement-health-ledger { grid-template-columns: repeat(3, 1fr); }
  .movement-health-ledger > div { border-bottom: 1px solid var(--line); }
  .movement-followup-grid { grid-template-columns: 1fr; }
  .movement-reconcile-form, .movement-suggestion-form { grid-template-columns: 1fr 1fr; }
  .movement-deadline-fields:not([hidden]) { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .movement-health-ledger { grid-template-columns: 1fr 1fr; }
  .movement-review-row { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .movement-status, .movement-action-summary { grid-column: 2; }
  .movement-primary span { white-space: normal; }
  .movement-reconcile-form, .movement-suggestion-form, .review-batch-actions, .portal-job-replay-form { grid-template-columns: 1fr; }
  .movement-deadline-fields:not([hidden]) { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .owner-sidebar, .topbar, .owner-topbar, .dra-law-button, .dra-law-panel { display: none !important; }
  .app-shell, .owner-shell { display: block; }
  .content, .owner-content { padding: 0; }
  .panel, .card { break-inside: avoid; box-shadow: none; }
}

/* =========================================================================
   Visual 2 — shell real baseado na opção 4 aprovada
   ========================================================================= */

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--bg);
}

.app-shell .sidebar {
  gap: 0;
  padding: 0;
  border-right-color: #20242c;
  background: #08090c;
  color: #f2ede2;
}

.sidebar-brand {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid #20242c;
}

.sidebar-brand-mark { width: 31px; height: 31px; object-fit: contain; }
.sidebar-brand-wordmark { width: 112px; height: auto; object-fit: contain; }
.sidebar-close-button { display: none !important; margin-left: auto; }

.app-shell .nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 25px 14px;
}

.app-shell .nav button {
  position: relative;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9b988f;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.app-shell .nav button::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 2px;
  height: 22px;
  background: transparent;
}

.app-shell .nav button i { font-size: 18px; }
.app-shell .nav button:hover { background: #141519; color: #f2ede2; }
.app-shell .nav button.active {
  border-color: transparent;
  background: #16171b;
  color: #f2ede2;
}
.app-shell .nav button.active::before { background: #cc9834; }
.nav-divider { height: 1px; margin: 12px 8px; background: #24262d; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid #20242c;
}

.workspace-identity,
.profile-identity {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
}

.profile-identity { margin-top: 6px; padding-top: 14px; border-top: 1px solid #20242c; }
.workspace-monogram,
.profile-avatar,
.topbar-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #23252c;
  color: #e1bc6a;
  font: 600 10px/1 var(--font-sans);
}
.workspace-identity strong,
.profile-identity strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #f2ede2;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-identity small,
.profile-identity small { display: block; margin-top: 2px; color: #7f817c; font-size: 9px; }
.sidebar-logout {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  margin-top: 6px;
  padding: 0 9px;
  border-color: transparent;
  background: transparent;
  color: #8f918c;
  font-size: 11px;
  font-weight: 400;
}
.sidebar-logout:hover { border-color: transparent; background: #16171b; color: #f2ede2; }

.app-shell .content { min-width: 0; padding: 0; background: var(--bg); }
.app-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr minmax(340px, 540px) 1fr;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0 34px;
  border: 0;
  border-bottom: 1px solid #272a31;
  border-radius: 0;
  background: #0a0b0e;
  color: #f2ede2;
  backdrop-filter: none;
}

.mobile-menu-button { display: none !important; }
.shell-icon-button,
.shell-utility-button,
.shell-theme-toggle button,
.shell-search-submit {
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: inherit;
}
.shell-icon-button:hover,
.shell-utility-button:hover,
.shell-theme-toggle button:hover,
.shell-search-submit:hover { border-color: #353944; background: #1c1f27; color: #fff; }

.shell-search {
  grid-column: 2;
  height: 40px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  padding: 0 4px 0 13px;
  border: 1px solid #323641;
  border-radius: 4px;
  background: #111319;
  color: #a9adba;
}
.shell-search:focus-within { border-color: #cc9834; box-shadow: 0 0 0 2px rgba(204,152,52,.15); }
.shell-search input {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f2ede2;
  box-shadow: none;
  font-size: 12px;
}
.shell-search input:focus { border: 0; background: transparent; box-shadow: none; }
.shell-search input::placeholder { color: #8f949f; }
.shell-search-submit { min-width: 30px; min-height: 30px; padding: 0; }
.app-shell .topbar-actions { justify-self: end; gap: 10px; }
.shell-utility-button { gap: 7px; color: #d4d5d8; font-size: 12px; font-weight: 500; }
.shell-utility-button:disabled { opacity: .38; }
.shell-theme-toggle { display: flex; padding: 2px; border: 1px solid #343843; border-radius: 4px; }
.shell-theme-toggle button { min-width: 29px; min-height: 27px; padding: 0; color: #a9adba; }
.shell-theme-toggle button.active { background: #272b34; color: #f2ede2; }
.topbar-avatar { border: 1px solid rgba(225,188,106,.45); }

.content-body { padding: 48px clamp(28px, 4vw, 66px) 64px; }
.page-heading { margin-bottom: 28px; }
.page-heading .eyebrow { color: var(--accent-strong); }
.page-heading h1 {
  margin: 4px 0 4px;
  font: 500 clamp(36px, 3.2vw, 49px)/1 var(--font-editorial);
  letter-spacing: -.025em;
}
.page-heading p { margin: 0; font-size: 12px; }
.app-shell #view-root { gap: 18px; }
.app-shell > .dra-law-button { display: none; }

.filter-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: min(420px, 94vw);
  height: 100vh;
  overflow-y: auto;
  padding: 34px;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background: var(--panel);
  box-shadow: -18px 0 60px rgba(0,0,0,.18);
  transform: translateX(102%);
  transition: transform .2s ease;
}
.app-shell.filter-open .filter-drawer { transform: translateX(0); }
.filter-drawer .section-title h2 { margin-top: 4px; }
.filter-drawer-close { width: 36px; min-width: 36px; padding: 0; }
.filter-drawer-context { margin: 0 0 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.filter-drawer .filters { grid-template-columns: 1fr; }
.shell-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(5,7,10,.5);
  backdrop-filter: blur(2px);
}
.app-shell.filter-open .shell-scrim { display: block; }

.today-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 28px; align-items: start; }
.today-ledger { border: 1px solid var(--line); background: var(--panel); }
.today-ledger-head,
.today-row { display: grid; grid-template-columns: 1.14fr 1.34fr 1.05fr 118px; gap: 24px; align-items: center; }
.today-ledger-head {
  min-height: 46px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted-2);
  font: 500 9px/1.3 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.today-row { min-height: 92px; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.today-row:hover { background: var(--panel-hover); }
.today-priority { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; align-items: center; }
.today-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted-3) 12%, transparent); }
.today-status-dot.critical { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.today-status-dot.warning { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.today-row strong { display: block; color: var(--text); font-size: 11px; font-weight: 500; line-height: 1.4; }
.today-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.today-action { justify-self: end; }
.today-action button { min-height: 34px; padding-inline: 12px; font-size: 10px; white-space: nowrap; }
.today-primary-action { border-color: var(--accent-strong); background: var(--accent); color: #17120a; }
.today-ledger-footer {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.today-ledger-footer:hover { border: 0; background: var(--panel-hover); color: var(--text); }
.today-empty { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); }
.today-empty i { font-size: 24px; color: var(--success); }
.today-empty strong { color: var(--text); font-size: 12px; }
.today-empty span { font-size: 10px; }
.today-summary { border-top: 2px solid var(--text); padding-top: 14px; }
.today-summary-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.today-summary h2 { margin: 0; font: 500 22px/1 var(--font-editorial); }
.today-summary-head span { color: var(--muted); font-size: 9px; }
.today-summary-stat { display: flex; align-items: baseline; gap: 8px; padding: 16px 2px; border-bottom: 1px solid var(--line); }
.today-summary-stat strong { font: 500 27px/1 var(--font-editorial); }
.today-summary-stat span { color: var(--muted); font-size: 10px; }
.today-summary-stat.critical strong { color: var(--danger); }
.today-summary-update { display: flex; align-items: center; gap: 7px; padding: 16px 2px; color: var(--muted); font-size: 9px; }
.today-assistant-action { width: 100%; min-height: 40px; border-color: var(--accent-strong); background: transparent; color: var(--accent-strong); font-size: 10px; font-weight: 500; }
.today-assistant-action:hover { background: var(--accent); color: #17120a; }

.dashboard-expanded { margin-top: 18px; border-top: 1px solid var(--line); }
.dashboard-expanded > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 500;
}
.dashboard-expanded > summary::-webkit-details-marker { display: none; }
.dashboard-expanded > summary::after { content: "+"; color: var(--accent-strong); font-size: 17px; }
.dashboard-expanded[open] > summary::after { content: "−"; }
.dashboard-expanded > summary small { margin-left: auto; color: var(--muted); font-size: 9px; font-weight: 400; }
.dashboard-expanded-body { display: grid; gap: 18px; padding-top: 6px; }

@media (max-width: 1120px) {
  .today-workspace { grid-template-columns: minmax(0, 1fr); }
  .today-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
  .today-summary-head, .today-summary-update, .today-assistant-action { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .app-shell { display: block; }
  .app-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(286px, 86vw);
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 18px 0 55px rgba(0,0,0,.3); }
  .app-shell.sidebar-open .shell-scrim { display: block; z-index: 20; }
  .sidebar-close-button { display: inline-flex !important; }
  .app-shell .topbar { grid-template-columns: auto minmax(220px, 1fr) auto; padding: 0 18px; }
  .mobile-menu-button { display: inline-flex !important; }
  .shell-search { grid-column: 2; }
}

@media (max-width: 720px) {
  .app-shell .topbar { min-height: 64px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; padding: 0 12px; }
  .shell-utility-button span, .shell-theme-toggle, .topbar-avatar { display: none; }
  .shell-search { height: 38px; }
  .shell-search-submit { display: none; }
  .shell-search { grid-template-columns: 18px minmax(0, 1fr); padding-right: 11px; }
  .content-body { padding: 30px 16px 48px; }
  .page-heading h1 { font-size: 38px; }
  .today-ledger-head { display: none; }
  .today-row { grid-template-columns: 1fr; gap: 12px; min-height: 0; padding: 20px 4px; }
  .today-process, .today-owner, .today-action { padding-left: 18px; }
  .today-action { justify-self: stretch; }
  .today-action button { width: 100%; }
  .today-ledger { border-inline: 0; }
  .today-ledger-footer { padding-inline: 4px; }
  .today-summary { grid-template-columns: repeat(3, 1fr); }
  .today-summary-stat { display: grid; gap: 4px; }
  .dashboard-expanded > summary small { display: none; }
  .filter-drawer { padding: 28px 22px; }
}

/* =========================================================================
   Visual 3 — operacao juridica: processos, prazos e documentos
   ========================================================================= */

.operation-ledger-shell { padding: 0; overflow: hidden; }
.operation-ledger-shell > .section-title { min-height: 70px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.operation-ledger-head,
.operation-ledger-row { display: grid; gap: 24px; align-items: center; }
.records-ledger-grid { grid-template-columns: minmax(210px, 1.1fr) minmax(190px, 1fr) minmax(180px, .9fr) minmax(180px, .8fr); }
.deadlines-ledger-grid { grid-template-columns: minmax(150px, .72fr) minmax(230px, 1.18fr) minmax(160px, .7fr) minmax(220px, 1fr); }
.operation-ledger-head {
  min-height: 42px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted-2);
  font: 500 9px/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.operation-ledger { gap: 0; }
.operation-ledger .operation-ledger-row {
  min-height: 88px;
  padding: 16px 22px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.operation-ledger .operation-ledger-row:last-child { border-bottom: 0; }
.operation-ledger .operation-ledger-row:hover { background: var(--panel-hover); transform: none; }
.operation-primary,
.operation-subject { min-width: 0; display: grid; gap: 5px; }
.operation-primary strong { font: 500 11px/1.35 var(--font-mono); letter-spacing: -.01em; }
.operation-primary span,
.operation-subject span { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; }
.operation-subject strong { overflow: hidden; color: var(--text); font-size: 10px; font-weight: 500; line-height: 1.4; text-overflow: ellipsis; }
.operation-context,
.operation-risk { align-content: center; gap: 5px; }
.operation-ledger-row .tag { padding: 4px 7px; font-size: 8px; letter-spacing: .025em; }

#view-root[data-current-view="recordDetail"] > .panel:first-child,
#view-root[data-current-view="deadlineDetail"] > .panel:first-child { border-top: 2px solid var(--text); }
#view-root[data-current-view="recordDetail"] .detail-grid,
#view-root[data-current-view="deadlineDetail"] .detail-grid { gap: 0; border: 1px solid var(--line); }
#view-root[data-current-view="recordDetail"] .detail-grid .card,
#view-root[data-current-view="deadlineDetail"] .detail-grid .card {
  min-height: 112px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.document-metrics-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); background: var(--panel); }
.document-metrics-strip .card { min-height: 126px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.document-metrics-strip .card:last-child { border-right: 0; }
.document-metrics-strip .card strong { font-size: 11px; line-height: 1.4; }
.document-metrics-strip .card .muted { font-size: 9px; line-height: 1.45; }
.documents-workbench { grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr); gap: 18px; align-items: start; }
.documents-workbench > .critical-surface { border-color: var(--line); background: var(--panel); box-shadow: none; }
.documents-workbench > .critical-surface > h2,
.documents-workbench > .critical-surface .section-title h2 { font: 500 22px/1.15 var(--font-editorial); }
.documents-workbench > .critical-surface > h2 { padding: 18px 22px 0; }
.documents-workbench > .critical-surface .empty { margin: 16px 22px; }
.documents-library > .section-title .muted { margin-top: 7px; font-size: 13px; line-height: 1.5; }
.documents-library > .list { gap: 12px; }
.documents-library > .list > .document-summary-card {
  margin: 0;
  padding: 22px 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}
.document-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.document-title-block { min-width: 0; display: grid; gap: 7px; }
.document-title-block .eyebrow { font-size: 9px; letter-spacing: .11em; }
.document-title-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.document-title-line > strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.document-version { color: var(--muted-2); font: 500 10px/1.3 var(--font-mono); white-space: nowrap; }
.document-primary-status { flex: 0 0 auto; }
.document-primary-status .tag { min-height: 28px; padding-inline: 11px; font-size: 10px; }
.document-primary-status .tag-success,
.document-card-tags .tag-success { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.document-primary-status .tag-warning,
.document-card-tags .tag-warning { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.document-primary-status .tag-danger,
.document-card-tags .tag-danger { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.document-card-summary { display: grid; gap: 4px; margin-top: 15px; }
.document-card-summary strong { color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.document-card-summary span { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.document-card-tags { margin-top: 14px; gap: 7px; }
.document-card-tags .tag { min-height: 24px; padding-inline: 9px; font-size: 9px; }
.document-card-facts {
  display: grid;
  grid-template-columns: minmax(140px, .9fr) minmax(130px, .75fr) minmax(190px, 1.35fr) minmax(160px, 1fr);
  margin-top: 18px;
  border-block: 1px solid var(--line-soft);
}
.document-card-facts > div { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--line-soft); }
.document-card-facts > div:first-child { padding-left: 0; }
.document-card-facts > div:last-child { padding-right: 0; border-right: 0; }
.document-card-facts span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-2);
  font: 500 9px/1.2 var(--font-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.document-card-facts strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.45;
}
.document-card-facts small { display: block; margin-top: 4px; color: var(--muted); font: 500 9px/1.35 var(--font-mono); }
.document-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -24px;
  padding: 14px 24px;
  background: var(--panel-muted);
}
.documents-library .document-card-footer .action-bar { gap: 8px; margin: 0; }
.documents-library .document-card-footer button { min-height: 38px; padding: 0 13px; font-size: 11px; }
.document-review-actions { flex: 0 0 auto; justify-content: flex-end; }
.document-viewer { min-height: 650px; border: 1px solid var(--line); border-radius: 0; background: #70737a; }
.document-engine-pages { display: grid; gap: 12px; }
.document-engine-text { max-height: 420px; border-radius: 0; font-size: 10px; line-height: 1.55; }

@media (max-width: 1240px) {
  .document-metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .document-metrics-strip .card:nth-child(3n) { border-right: 0; }
  .document-metrics-strip .card:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .document-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-card-facts > div:nth-child(2) { border-right: 0; }
  .document-card-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .document-card-facts > div:nth-child(3) { padding-left: 0; }
  .records-ledger-grid { grid-template-columns: minmax(190px, 1fr) minmax(170px, 1fr) minmax(170px, .85fr); }
  .records-ledger-grid > :nth-child(4) { grid-column: 2 / -1; }
  .operation-ledger-head.records-ledger-grid > :nth-child(4) { display: none; }
}

@media (max-width: 980px) {
  .documents-workbench { grid-template-columns: 1fr; }
  .operation-ledger-head { display: none; }
  .records-ledger-grid,
  .deadlines-ledger-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; }
  .records-ledger-grid > :nth-child(4) { grid-column: auto; }
}

@media (max-width: 620px) {
  .operation-ledger .operation-ledger-row { grid-template-columns: 1fr; min-height: 0; padding: 18px 16px; }
  .document-metrics-strip { grid-template-columns: 1fr 1fr; }
  .document-metrics-strip .card { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .document-metrics-strip .card:nth-child(2n) { border-right: 0; }
  .documents-library > .list > .document-summary-card { padding: 18px 16px 0; }
  .document-card-header { display: grid; gap: 12px; }
  .document-primary-status { justify-self: start; }
  .document-card-facts { grid-template-columns: 1fr; }
  .document-card-facts > div { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .document-card-facts > div:last-child { border-bottom: 0; }
  .document-card-footer { align-items: stretch; margin-inline: -16px; padding: 14px 16px; flex-direction: column; }
  .document-card-footer .action-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-card-footer button { width: 100%; }
  .document-review-actions { justify-content: stretch; }
  .document-viewer { min-height: 480px; }
}

/* =========================================================================
   Visual 4 — estacao juridica da Dra. Law, leitor e editor
   ========================================================================= */

#view-root[data-current-view="draLaw"] { gap: 22px; }
.dra-law-station { grid-template-columns: 310px minmax(0, 1fr); gap: 18px; align-items: start; }
.dra-law-station > .critical-surface { border-color: var(--line); background: var(--panel); box-shadow: none; }
.dra-law-station .dra-law-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 0;
}
.dra-law-sidebar > .section-title { margin: 0; padding: 18px; border-bottom: 1px solid var(--line); }
.dra-law-sidebar > .section-title h2 { font: 500 16px/1.2 var(--font-mono); }
.dra-law-sidebar > .list,
.dra-law-sidebar > .card { margin: 14px 16px; }
.dra-law-sidebar > .card,
.dra-law-sidebar .list-item { border-radius: 2px; box-shadow: none; }
.dra-law-sidebar .checkbox-card { grid-template-columns: 16px minmax(0, 1fr); padding: 11px; }

.dra-law-workspace { gap: 16px; padding: 0; overflow: hidden; border-color: var(--line); background: var(--panel); box-shadow: none; }
.dra-law-workspace > .section-title { min-height: 78px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dra-law-workspace > .section-title h2 { font: 500 25px/1.1 var(--font-editorial); }
.dra-law-composer-card { display: grid; gap: 14px; padding: 20px 22px; }
.dra-law-composer-card > .card { border-radius: 2px; background: var(--panel-strong); box-shadow: none; }
.dra-law-composer-card > .card:first-child { border-left: 2px solid var(--accent-strong); }
.dra-law-profile-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.dra-law-profile-selector button { min-height: 38px; border: 0; border-radius: 0; background: var(--panel); color: var(--muted); }
.dra-law-profile-selector button:not(.secondary) { background: var(--text); color: var(--panel); }
.dra-law-strategy-grid { gap: 12px; }
.dra-law-composer-card textarea#dra-law-prompt { min-height: 150px; font: 400 13px/1.65 var(--font-sans); }

.dra-law-conversation-panel { margin: 0 22px 22px; padding: 0; overflow: hidden; border-top: 2px solid var(--text); }
.dra-law-conversation-panel > .section-title { min-height: 72px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dra-law-conversation-panel > .list,
.dra-law-conversation-panel > .empty,
.dra-law-conversation-panel > .dra-law-message-list { margin: 18px 22px; }
.dra-law-draft-editor {
  margin: 22px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel-strong);
  box-shadow: none;
}
.dra-law-draft-editor > header { min-height: 60px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dra-law-draft-editor > label { margin: 16px 18px; }
.dra-law-draft-editor #dra-law-versioned-editor {
  min-height: 650px;
  padding: 58px clamp(30px, 7vw, 86px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffefb;
  color: #17191e;
  box-shadow: 0 14px 35px rgba(18,22,31,.08);
  font: 400 14px/1.8 Georgia, "Times New Roman", serif;
  resize: vertical;
}
[data-theme-resolved="dark"] .dra-law-draft-editor #dra-law-versioned-editor { background: #e9e6de; color: #17191e; }
.dra-law-draft-editor > .form-actions,
.dra-law-draft-editor > .muted { margin: 0 18px 18px; }
.dra-law-version-comparison { margin: 0 18px 18px; border-top: 1px solid var(--line); }
.dra-law-version-comparison > summary { padding: 16px 0; cursor: pointer; font-weight: 650; }
.dra-law-version-comparison > label { display: grid; gap: 7px; max-width: 520px; margin-bottom: 14px; }
.dra-law-diff-legend { display: flex; gap: 18px; margin: 8px 0; color: var(--muted); font-size: 11px; }
.dra-law-diff-document {
  max-height: 560px;
  overflow: auto;
  padding: 32px clamp(20px, 5vw, 64px);
  border: 1px solid var(--line);
  background: #fffefb;
  color: #17191e;
  white-space: pre-wrap;
  font: 400 14px/1.8 Georgia, "Times New Roman", serif;
}
.dra-law-diff-document ins { background: #e1f2e5; color: #155d30; text-decoration: none; }
.dra-law-diff-document del { background: #f8e1dd; color: #8a2e22; text-decoration-thickness: 1px; }
.dra-law-diff-notice { padding: 18px; border-left: 2px solid var(--warning); background: var(--panel); color: var(--text); }
.dra-law-message-list { gap: 12px; }
.dra-law-message { border-radius: 2px; box-shadow: none; }
.dra-law-message-user { margin-left: clamp(24px, 10%, 100px); background: var(--panel-strong); }
.dra-law-message-assistant { margin-right: clamp(24px, 6%, 72px); border-left: 2px solid var(--accent-strong); }
.dra-law-legal-research { margin: 22px; border: 1px solid var(--line); border-left: 2px solid var(--accent-strong); border-radius: 2px; box-shadow: none; }

.dra-law-operational-disclosure { border-top: 1px solid var(--line); }
.dra-law-operational-disclosure > summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 600;
}
.dra-law-operational-disclosure > summary::-webkit-details-marker { display: none; }
.dra-law-operational-disclosure > summary::before { content: "+"; color: var(--accent-strong); font-size: 17px; }
.dra-law-operational-disclosure[open] > summary::before { content: "−"; }
.dra-law-operational-disclosure > summary small { margin-left: auto; color: var(--muted); font-size: 9px; font-weight: 400; }
.dra-law-operational-disclosure-body { display: grid; gap: 18px; }
.dra-law-operational-disclosure-body > .critical-surface { border-color: var(--line); background: var(--panel); box-shadow: none; }

@media (max-width: 1120px) {
  .dra-law-station { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .dra-law-station { grid-template-columns: 1fr; }
  .dra-law-station .dra-law-sidebar { position: relative; top: auto; max-height: none; }
  .dra-law-sidebar > .list.compact-list,
  .dra-law-sidebar > .dra-law-document-list { max-height: 300px; overflow: auto; }
  .dra-law-draft-editor #dra-law-versioned-editor { min-height: 520px; padding: 38px 34px; }
  .dra-law-record-row { grid-template-columns: 1fr; }
  .dra-law-record-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .dra-law-document-launchpad { padding: 18px; }
  .dra-law-launch-heading,
  .dra-law-record-picker > header { display: grid; gap: 14px; }
  .dra-law-launch-heading > button,
  .dra-law-record-picker > header button { width: 100%; }
  .dra-law-launch-flow { grid-template-columns: 1fr; }
  .dra-law-record-actions { display: grid; grid-template-columns: 1fr; }
  .dra-law-record-actions button { width: 100%; }
  .dra-law-composer-card { padding: 16px; }
  .dra-law-conversation-panel { margin: 0 16px 16px; }
  .dra-law-profile-selector { grid-template-columns: 1fr; }
  .dra-law-draft-editor { margin: 16px; }
  .dra-law-draft-editor #dra-law-versioned-editor { min-height: 440px; padding: 28px 20px; font-size: 13px; }
  .dra-law-legal-research { margin: 16px; }
  .dra-law-message-user,
  .dra-law-message-assistant { margin-inline: 0; }
}

/* =========================================================================
   Visual 5 — console administrativo Owner
   ========================================================================= */

.owner-shell { grid-template-columns: 244px minmax(0, 1fr); background: var(--bg); }
.owner-sidebar {
  gap: 0;
  padding: 0;
  border-right-color: #20242c;
  background: #08090c;
  color: #f2ede2;
}
.owner-sidebar-brand { min-height: 76px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid #20242c; }
.owner-sidebar-brand span { margin-left: auto; padding: 4px 5px; border: 1px solid #5d4a28; color: #d9b666; font: 500 7px/1 var(--font-mono); letter-spacing: .12em; }
.owner-scope { display: grid; gap: 5px; padding: 20px 20px 12px; }
.owner-scope span { color: #6f726e; font: 500 8px/1 var(--font-mono); letter-spacing: .12em; }
.owner-scope strong { overflow: hidden; color: #d9d6cd; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.owner-nav { display: flex; flex-direction: column; gap: 3px; padding: 8px 14px 22px; }
.owner-nav button {
  position: relative;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9b988f;
  font-size: 11px;
  font-weight: 400;
  text-align: left;
}
.owner-nav button::before { content: ""; position: absolute; left: -14px; width: 2px; height: 22px; background: transparent; }
.owner-nav button i { font-size: 17px; }
.owner-nav button:hover { border-color: transparent; background: #141519; color: #f2ede2; }
.owner-nav button.active { border-color: transparent; background: #16171b; color: #f2ede2; }
.owner-nav button.active::before { background: #cc9834; }
.owner-nav-divider { height: 1px; margin: 12px 8px; background: #24262d; }
.owner-logout { width: calc(100% - 28px); min-height: 38px; justify-content: flex-start; gap: 9px; margin: auto 14px 16px; border-color: #26282f; background: transparent; color: #92948f; font-size: 10px; }
.owner-logout:hover { background: #16171b; color: #f2ede2; }

.owner-content { min-width: 0; padding: 0; background: var(--bg); }
.owner-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 14px clamp(28px, 4vw, 60px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}
.owner-topbar h1 { margin: 3px 0 2px; font: 500 29px/1 var(--font-editorial); }
.owner-topbar p { max-width: 700px; }
.owner-readonly-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); color: var(--muted); font: 500 8px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
#owner-messages { margin: 0 clamp(28px, 4vw, 60px); }
#owner-view-root { gap: 18px; padding: 34px clamp(28px, 4vw, 60px) 64px; }

.owner-command-center { padding: 0; overflow: hidden; border-color: var(--line); background: var(--panel); box-shadow: none; }
.owner-console-sheet { padding: 0; overflow: hidden; border-color: var(--line); background: var(--panel); box-shadow: none; }
.owner-console-header { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; min-height: 108px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.owner-console-header h2 { margin: 4px 0 7px; font: 500 28px/1.08 var(--font-editorial); }
.owner-console-header p { max-width: 760px; margin: 0; color: var(--muted); }
.owner-console-header > small { white-space: nowrap; color: var(--muted); }
.owner-metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.owner-metric { min-height: 112px; padding: 20px 24px; border-right: 1px solid var(--line); }
.owner-metric:last-child { border-right: 0; }
.owner-metric span, .owner-metric small { display: block; color: var(--muted); }
.owner-metric span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.owner-metric strong { display: block; margin: 9px 0 5px; font: 500 23px/1 var(--font-editorial); overflow-wrap: anywhere; }
.owner-next-action, .owner-console-note { padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--panel-subtle); }
.owner-next-action span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.owner-next-action strong { font-size: 12px; line-height: 1.55; }
.owner-console-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.owner-ledger { display: grid; }
.owner-ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, auto) auto; gap: 20px; align-items: center; min-height: 66px; padding: 13px 24px; border-bottom: 1px solid var(--line); }
.owner-ledger-row:last-child { border-bottom: 0; }
.owner-ledger-row:hover { background: var(--panel-hover); }
.owner-ledger-row strong, .owner-ledger-row small { display: block; }
.owner-ledger-row strong { font-size: 11px; }
.owner-ledger-row small { margin-top: 4px; color: var(--muted); }
.owner-ledger-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.owner-empty-state { padding: 30px 24px; color: var(--muted); }
.owner-console-sheet > .action-bar { padding: 18px 24px; border-top: 1px solid var(--line); }
.owner-command-center > .section-title { min-height: 76px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.owner-command-center > .section-title h2 { font: 500 26px/1.1 var(--font-editorial); }
.owner-status-strip { grid-template-columns: repeat(3, 1fr); gap: 0; border-bottom: 1px solid var(--line); }
.owner-status-strip .card { min-height: 124px; padding: 20px 22px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.owner-status-strip .card:last-child { border-right: 0; }
.owner-status-strip .card strong { display: block; margin: 5px 0; font-size: 11px; line-height: 1.45; }
.owner-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 22px 10px; }
.owner-section-label h2 { margin: 0; font: 500 20px/1 var(--font-editorial); }
.owner-section-label small { color: var(--muted); font: 400 8px/1 var(--font-mono); text-transform: uppercase; }
.owner-release-blockers { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 22px 18px; border: 1px solid var(--line); }
.owner-release-blockers .nested-panel { min-height: 105px; padding: 16px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--panel-strong); }
.owner-release-blockers .nested-panel:last-child { border-right: 0; }
.owner-release-blockers strong { color: var(--text); font-size: 10px; font-weight: 600; }
.owner-release-blockers .muted { margin-top: 7px; font-size: 9px; }
.owner-command-center > .action-bar { padding: 0 22px 22px; }

.owner-gates-panel,
.owner-infrastructure-panel,
.owner-resource-panel { padding: 0; overflow: hidden; box-shadow: none; }
.owner-gates-panel > .section-title,
.owner-infrastructure-panel > .section-title,
.owner-resource-panel > .section-title { min-height: 66px; margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.owner-gate-list { gap: 0; }
.owner-gate-list li { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 20px; border-bottom: 1px solid var(--line-soft); }
.owner-gate-list li:last-child { border-bottom: 0; }
.owner-gate-list strong { font: 500 10px/1.4 var(--font-mono); }
.owner-infrastructure-panel > .detail-grid,
.owner-resource-panel > .detail-grid { gap: 0; }
.owner-infrastructure-panel .card,
.owner-resource-panel .card { min-height: 108px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }

@media (max-width: 1160px) {
  .owner-release-blockers { grid-template-columns: repeat(3, 1fr); }
  .owner-release-blockers .nested-panel { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .owner-shell { grid-template-columns: 1fr; }
  .owner-sidebar { position: relative; width: 100%; height: auto; }
  .owner-sidebar-brand { min-height: 64px; }
  .owner-scope { display: none; }
  .owner-nav { flex-direction: row; overflow-x: auto; padding: 10px 14px; }
  .owner-nav button { flex: 0 0 auto; }
  .owner-nav-divider { width: 1px; height: 30px; margin: 6px 8px; }
  .owner-logout { position: absolute; top: 13px; right: 14px; width: 38px; margin: 0; padding: 0; justify-content: center; }
  .owner-logout span { display: none; }
  .owner-topbar { position: relative; padding: 20px; }
  #owner-view-root { padding: 24px 18px 48px; }
  #owner-messages { margin-inline: 18px; }
  .owner-release-blockers { grid-template-columns: 1fr 1fr; }
  .owner-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .owner-topbar { display: grid; }
  .owner-readonly-badge { display: none; }
  .owner-status-strip { grid-template-columns: 1fr; }
  .owner-status-strip .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .owner-console-header { display: grid; min-height: 0; padding: 20px 18px; }
  .owner-console-header > small { white-space: normal; }
  .owner-metric { min-height: 96px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
  .owner-ledger-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 15px 18px; }
  .owner-ledger-row .tag { grid-column: 1 / -1; justify-self: start; }
  .owner-release-blockers { grid-template-columns: 1fr; }
  .owner-release-blockers .nested-panel { border-right: 0; }
}

/* =========================================================================
   Visual 6 — autenticacao, estados, acessibilidade e hardening mobile
   ========================================================================= */

.login-shell { padding: 0; background: #08090c; }
.shell-utility-bar { min-height: 58px; margin: 0; padding: 0 clamp(20px, 4vw, 58px); border-bottom: 1px solid #24262d; color: #d9d6cd; }
.shell-utility-bar .login-back-link { border-color: transparent; background: transparent; color: #9da09c; font-size: 10px; }
.shell-utility-bar .theme-control { color: #9da09c; }
.shell-utility-bar .theme-control select { min-height: 32px; border-color: #343843; background: #111319; color: #e7e3da; }
.login-layout { min-height: calc(100vh - 58px); grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 0; }
.login-hero-panel {
  min-height: calc(100vh - 58px);
  padding: clamp(42px, 6vw, 86px);
  border: 0;
  border-right: 1px solid #24262d;
  border-radius: 0;
  background: #0a0b0e;
  color: #f1ede4;
  box-shadow: none;
}
.login-brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(54px, 8vh, 90px); }
.login-brand-lockup img:first-child { width: 38px; height: 38px; object-fit: contain; }
.login-brand-lockup img:last-child { width: 142px; height: auto; object-fit: contain; }
.login-hero-panel .eyebrow { color: #c99a42; }
.login-hero-panel h1 { max-width: 760px; margin: 14px 0 22px; color: #f3efe5; font: 500 clamp(48px, 5.2vw, 76px)/.98 var(--font-editorial); letter-spacing: -.035em; }
.login-hero-panel .login-hero-lead { max-width: 660px; color: #9da09c; font-size: 13px; line-height: 1.75; }
.login-stage-badge { display: inline-flex; align-items: center; gap: 6px; border-color: #5d4a28; color: #d7b463; font-size: 7px; }
.login-hero-grid { margin-top: 40px; border-color: #2b2d34; border-radius: 2px; }
.login-signal-panel { min-height: 152px; padding: 20px; border-right-color: #2b2d34; background: #101216; }
.login-signal-panel.emphasis { background: #15140f; }
.login-signal-panel strong { color: #ece8df; font-size: 12px; font-weight: 500; }
.login-signal-panel p { color: #8f928e; font-size: 10px; }
.login-signal-kicker { color: #c99a42; }
.login-evidence-strip { border-color: #2b2d34; }
.login-evidence-strip > div { border-color: #2b2d34; }
.login-evidence-strip span { color: #6f726e; }
.login-evidence-strip strong { color: #d9d6cd; font-size: 11px; font-weight: 500; }
.login-command-board { border-color: #2b2d34; }
.login-command-list li { border-color: #24262d; color: #878a86; font-size: 10px; }
.login-command-list strong { color: #d7d4cc; font-weight: 500; }

.login-stack { align-content: start; min-width: 0; padding: clamp(36px, 5vw, 76px); background: var(--bg); }
.login-panel,
.login-support-panel { border: 1px solid var(--line); border-radius: 3px; background: var(--panel); box-shadow: none; }
.login-panel h2 { font: 500 34px/1.05 var(--font-editorial); }
.login-panel-chip { border-color: var(--line-strong); color: var(--muted); font-size: 7px; }
.login-panel label { font-size: 10px; }
.login-panel label > .muted { display: block; margin-top: 5px; font-size: 8px; }
.login-panel button[type="submit"] { min-height: 44px; }
.login-actions-row button { font-size: 9px; }
.login-support-panel .section-title h3 { font: 500 25px/1.1 var(--font-editorial); }

#view-root,
#owner-view-root { position: relative; }
#view-root.view-loading::before,
#owner-view-root.view-loading::before {
  content: "";
  position: fixed;
  z-index: 90;
  top: 76px;
  left: 244px;
  width: calc(100% - 244px);
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-strong) 45%, transparent 100%);
  background-size: 45% 100%;
  animation: officelaw-loading 1s linear infinite;
}
@keyframes officelaw-loading { from { background-position: -60% 0; } to { background-position: 160% 0; } }

.empty,
.empty-state { border-color: var(--line); border-radius: 2px; background: var(--panel-strong); color: var(--muted); font-size: 10px; }
.operation-empty { min-height: 180px; display: grid; place-items: center; margin: 0; border: 0; border-radius: 0; }
.feedback { margin-block: 10px; padding: 10px 12px; border-left: 2px solid var(--line-strong); background: var(--panel-strong); font-size: 10px; }
.feedback:empty { display: none; }
.feedback-error { border-left-color: var(--danger); color: var(--danger); }
.feedback-success { border-left-color: var(--success); color: var(--success); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-strong) 18%, transparent);
}
button:disabled,
input:disabled,
select:disabled { cursor: not-allowed; opacity: .52; }

@media (max-width: 1100px) {
  .login-layout { grid-template-columns: minmax(0, 1fr) 420px; }
  .login-hero-panel { padding: 48px; }
  .login-stack { padding: 36px; }
}

@media (max-width: 860px) {
  .login-layout { display: flex; flex-direction: column; }
  .login-stack { order: 1; }
  .login-hero-panel { order: 2; }
  .login-hero-panel { min-height: auto; padding: 42px 30px; border-right: 0; border-bottom: 1px solid #24262d; }
  .login-brand-lockup { margin-bottom: 44px; }
  .login-hero-panel h1 { max-width: 620px; font-size: 50px; }
  .login-stack { padding: 30px; }
  #view-root.view-loading::before,
  #owner-view-root.view-loading::before { top: 64px; left: 0; width: 100%; }
}

@media (max-width: 620px) {
  .shell-utility-bar { padding-inline: 12px; }
  .shell-utility-bar .login-back-link { max-width: 52%; }
  .login-hero-panel { padding: 34px 22px; }
  .login-brand-lockup { margin-bottom: 38px; }
  .login-brand-lockup img:first-child { width: 32px; height: 32px; }
  .login-brand-lockup img:last-child { width: 122px; }
  .login-hero-topline { display: block; }
  .login-stage-badge { margin-top: 20px; }
  .login-hero-panel h1 { font-size: 42px; }
  .login-hero-grid { grid-template-columns: 1fr; }
  .login-signal-panel { min-height: 0; border-right: 0; border-bottom: 1px solid #2b2d34; }
  .login-stack { padding: 18px 14px 34px; }
  .login-panel,
  .login-support-panel { padding: 22px 18px; }
  .login-actions-row { grid-template-columns: 1fr; }
  .app-shell :where(button, .btn),
  .owner-shell :where(button, .btn) { min-height: 42px; }
  .dra-law-station .dra-law-sidebar { max-height: 460px; overflow: auto; }
  .filter-drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  #view-root.view-loading::before,
  #owner-view-root.view-loading::before { animation: none; background: var(--accent-strong); }
}
:focus-visible { outline: 3px solid var(--accent, #e77223); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 9999; top: 10px; left: 10px; transform: translateY(-160%); padding: 10px 14px; background: #111; color: #fff; border-radius: 4px; }
.skip-link:focus { transform: translateY(0); }

.access-contract-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line, #2f3540);
  border-radius: 16px;
  padding: 0;
  color: var(--text, #f4f4f4);
  background: var(--surface, #17191d);
}

.access-contract-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(4px);
}

.access-contract-dialog form { display: grid; gap: 14px; padding: 24px; }
.access-contract-content { max-height: 44vh; overflow: auto; padding: 16px; border: 1px solid var(--line, #2f3540); border-radius: 10px; background: rgb(255 255 255 / 3%); }
.access-contract-content section + section { margin-top: 18px; }
.access-contract-content h3 { margin: 0 0 6px; }
.access-contract-content p { margin: 6px 0; }
.access-contract-links, .access-contract-confirmation { line-height: 1.5; }
.access-contract-confirmation { display: flex; align-items: flex-start; gap: 10px; }
/* Mesa diária: monitoramento público, triagem explicável e calendário governado. */
.daily-intelligence {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--accent, #e1bc6a) 36%, var(--border, #e5e7eb));
  border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent, #e1bc6a) 8%, var(--surface, #fff)), var(--surface, #fff));
}
.daily-intelligence-head, .daily-intelligence-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.daily-intelligence-head h2 { margin: 4px 0 6px; }
.daily-intelligence-head p { max-width: 780px; margin: 0; color: var(--muted, #667085); }
.daily-desk-switch { display: flex; gap: 6px; white-space: nowrap; }
.daily-desk-switch button.active { color: var(--surface, #fff); background: var(--text, #101828); }
.daily-intelligence-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.daily-intelligence-metrics article { display: grid; gap: 3px; min-width: 0; padding: 13px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--surface, #fff); }
.daily-intelligence-metrics article.attention { border-color: #d4a94f; }
.daily-intelligence-metrics article.critical { border-color: #c83d4b; }
.daily-intelligence-metrics span, .daily-intelligence-metrics small { color: var(--muted, #667085); }
.daily-intelligence-metrics strong { font-size: 1.45rem; }
.daily-triage-list { display: grid; gap: 8px; }
.daily-triage-row { display: grid; grid-template-columns: minmax(160px, .55fr) minmax(210px, .8fr) minmax(260px, 1.4fr) auto; align-items: center; gap: 14px; width: 100%; padding: 13px 15px; border: 1px solid var(--border, #e5e7eb); border-left: 4px solid #718096; border-radius: 12px; color: inherit; text-align: left; background: var(--surface, #fff); }
.daily-triage-row.severity-warning { border-left-color: #d4a94f; }
.daily-triage-row.severity-critical { border-left-color: #c83d4b; }
.daily-triage-row span { min-width: 0; }
.daily-triage-row strong, .daily-triage-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-triage-row small { margin-top: 3px; color: var(--muted, #667085); }
.daily-triage-code { font-weight: 700; }
.daily-intelligence-actions { align-items: center; }
.daily-intelligence-actions > span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.daily-operations-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; }
.daily-operations-grid > article { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 15px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; background: var(--surface, #fff); }
.daily-operations-grid small { color: var(--muted, #667085); }
.daily-briefing-list, .daily-calendar-list, .daily-hygiene-list { display: grid; gap: 6px; }
.daily-briefing-list button, .daily-hygiene-list button { display: grid; gap: 2px; padding: 9px 10px; border: 1px solid var(--border, #e5e7eb); border-left: 3px solid #718096; border-radius: 9px; color: inherit; text-align: left; background: transparent; }
.daily-briefing-list button.severity-warning { border-left-color: #d4a94f; }
.daily-briefing-list button.severity-critical { border-left-color: #c83d4b; }
.daily-calendar-list a, .daily-calendar-list span { font-size: .86rem; overflow-wrap: anywhere; }
.daily-hygiene-panel { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid color-mix(in srgb, #d4a94f 48%, var(--border, #e5e7eb)); border-radius: 14px; background: color-mix(in srgb, #d4a94f 5%, var(--surface, #fff)); }
.daily-hygiene-panel > div:first-child { display: grid; gap: 4px; }
.daily-hygiene-panel small { color: var(--muted, #667085); }
.daily-hygiene-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .daily-intelligence-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .daily-operations-grid { grid-template-columns: 1fr 1fr; }
  .daily-briefing-card { grid-column: 1 / -1; }
  .daily-triage-row { grid-template-columns: minmax(140px, .6fr) minmax(190px, .8fr) minmax(240px, 1.2fr) auto; }
}

@media (max-width: 720px) {
  .daily-intelligence { padding: 16px; }
  .daily-intelligence-head, .daily-intelligence-actions { align-items: stretch; flex-direction: column; }
  .daily-desk-switch { width: 100%; }
  .daily-desk-switch button { flex: 1; }
  .daily-intelligence-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-operations-grid, .daily-hygiene-panel, .daily-hygiene-list { grid-template-columns: minmax(0, 1fr); }
  .daily-briefing-card { grid-column: auto; }
  .daily-triage-row { grid-template-columns: minmax(0, 1fr) auto; }
  .daily-triage-row > span:nth-child(2), .daily-triage-row > span:nth-child(3) { grid-column: 1 / -1; }
  .daily-intelligence-actions > span { justify-content: flex-start; }
}

/* Central de capturas: triagem operacional e homologação dos adaptadores. */
.portal-center-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--accent, #e1bc6a) 42%, transparent);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #e1bc6a) 12%, var(--surface, #fff)), var(--surface, #fff));
}

.portal-center-hero h2 { max-width: 780px; margin: 6px 0 8px; }
.portal-center-hero p { max-width: 760px; margin: 0; color: var(--muted, #667085); }

.portal-center-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.portal-center-summary article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.portal-center-summary article.is-critical { border-color: color-mix(in srgb, #c83d4b 46%, var(--border, #e5e7eb)); }
.portal-center-summary span, .portal-center-summary small { color: var(--muted, #667085); }
.portal-center-summary strong { font-size: 1.8rem; line-height: 1; }

.portal-center-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
  gap: 18px;
  align-items: start;
}

.portal-center-side { display: grid; gap: 18px; }
.portal-divergence-list, .portal-job-list { display: grid; gap: 10px; }

.portal-divergence-row {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-left: 4px solid #d4a94f;
  border-radius: 12px;
  background: var(--surface, #fff);
}

.portal-divergence-row.portal-divergence-critical { border-left-color: #c83d4b; }
.portal-divergence-heading, .portal-adapter-heading, .portal-job-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-divergence-heading > div, .portal-adapter-heading > div, .portal-job-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portal-divergence-row p, .portal-adapter-card p { margin: 0; color: var(--muted, #667085); }
.portal-divergence-row small, .portal-adapter-card small, .portal-job-row small { display: block; color: var(--muted, #667085); }

.portal-adapters-panel, .portal-diagnostics-panel { margin-top: 18px; }
.portal-adapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-adapter-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.portal-adapter-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.portal-adapter-metrics span { display: grid; gap: 2px; color: var(--muted, #667085); font-size: .8rem; }
.portal-adapter-metrics strong { color: var(--text, #101828); font-size: 1.05rem; }
.portal-adapter-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; color: var(--muted, #667085); font-size: .82rem; }

.portal-safety-card ul { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 20px; }
.portal-diagnostic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.portal-diagnostic-list article { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; }

@media (max-width: 1100px) {
  .portal-center-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-center-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .portal-center-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .portal-center-summary, .portal-adapter-grid, .portal-diagnostic-list { grid-template-columns: minmax(0, 1fr); }
  .portal-divergence-heading, .portal-adapter-heading, .portal-job-row { align-items: stretch; flex-direction: column; }
}
