/* =========================================================
   SISTEMA JURÍDICO / ALSO_SYS
   STYLE GLOBAL CONSOLIDADO
   ========================================================= */

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --border: #e5e7eb;
  --border-soft: #eef2f7;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-soft: #64748b;
  --text-muted: #94a3b8;

  --primary: #000C1F;
  --primary-2: #2563eb;
  --primary-2-hover: #1d4ed8;
  --primary-light: #dbeafe;

  --success: #16a34a;
  --success-soft: #dcfce7;

  --warning: #d97706;
  --warning-soft: #fef3c7;

  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --shadow-xs: 0 2px 6px rgba(15,23,42,.04);
  --shadow-sm: 0 6px 18px rgba(15,23,42,.05);
  --shadow-md: 0 12px 32px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --topbar-max: 1600px;
  --content-width: 90vw;
  --content-max: 1600px;
}

/* =========================================================
   RESET / BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

p {
  line-height: 1.5;
}

/* =========================================================
   ÁREAS PRINCIPAIS
   ========================================================= */

.page-header,
.dashboard,
.container {
  width: min(var(--content-width), var(--content-max));
  margin-left: auto;
  margin-right: auto;
}

.dashboard-grid {
  width: 100%;
}

.main-content {
  width: 100%;
}

.main-content.with-sidebar {
  padding-left: 0;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
  width: 100%;
  background: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 1200;
}

.topbar-content {
  max-width: var(--topbar-max);
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
}

.logo {
  min-width: 140px;
  display: flex;
  align-items: center;
}

.logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.menu-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-button {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #fff;
  padding: 0 20px;
  min-height: 42px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: .18s ease;
}

.menu-button:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
}

.menu-button.active-tab {
  background: var(--primary-2-hover);
  border-color: var(--primary-2-hover);
  color: #fff;
  box-shadow: 0 8px 20px rgba(29,78,216,.22);
}

.user-area {
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.status-time {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 14px;
  white-space: nowrap;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
  margin-top: 28px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.page-header-compact {
  margin-top: 24px;
  margin-bottom: 10px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* =========================================================
   CONTAINER / CARDS
   ========================================================= */

.container {
  background: var(--surface);
  border: 1px solid rgba(229,231,235,.95);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  padding: 28px 30px;
  margin-bottom: 30px;
}

.container-flat {
  padding: 18px 22px;
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
}

.container-table-focus {
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 26px 30px 30px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

.form-card {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 18px;
}

/* =========================================================
   DASHBOARD ANTIGO / STAT CARDS
   ========================================================= */

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

.dashboard-compact {
  margin-top: 0;
  margin-bottom: 18px;
  gap: 12px;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 18px;
  padding: 14px 16px;
  min-height: 88px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(37,99,235,.20), rgba(0,12,31,.12));
}

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

.stat-left {
  flex: 1;
  min-width: 0;
}

.stat-title {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-soft);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f3f6fb;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid #e7edf5;
}

.stat-icon.success {
  background: #ecfdf3;
  color: #16a34a;
  border-color: #d7f5e3;
}

.stat-icon.warning {
  background: #fff7e8;
  color: #d97706;
  border-color: #fde8bf;
}

.stat-icon.info {
  background: #eef4ff;
  color: #2563eb;
  border-color: #d9e7ff;
}

.stat-icon.neutral {
  background: #f3f4f6;
  color: #475569;
  border-color: #e5e7eb;
}

.dashboard-compact .stat-card {
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
}

.dashboard-compact .stat-card::after {
  height: 2px;
  opacity: .7;
}

.dashboard-compact .stat-title {
  font-size: 12px;
  margin-bottom: 2px;
}

.dashboard-compact .stat-value {
  font-size: 18px;
}

.dashboard-compact .stat-meta {
  font-size: 11px;
  margin-top: 4px;
}

.dashboard-compact .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
}

/* =========================================================
   DASHBOARD GRID / METRIC CARDS
   Usado por CRM e Qualidade.
   ========================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.metric-value,
.metric-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: 8px;
}

.metric-value.danger {
  color: var(--danger);
}

.metric-caption,
.metric-card small {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
}

/* =========================================================
   FORMULÁRIOS
   ========================================================= */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

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

.form-group,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label,
.form-field label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
}

select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="datetime-local"],
input[type="file"],
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  padding: 0 16px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

input[type="datetime-local"],
input[type="file"] {
  padding: 15px 16px;
}

textarea {
  min-height: 140px;
  padding: 16px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

input[readonly] {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.unidade-field {
  max-width: 220px;
}

.detail-label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

/* =========================================================
   FILTROS / BUSCA
   ========================================================= */

.search-box {
  width: 100%;
  margin-bottom: 24px;
}

.search-box input {
  width: 100%;
  min-height: 72px;
  border-radius: 24px;
  border: 1px solid #dbe3ee;
  background: #fff;
  padding: 0 26px;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-xs);
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}

.filter-panel .form-grid {
  gap: 18px;
  margin-bottom: 18px;
}

.filter-panel .quick-actions {
  margin-top: 6px;
  margin-bottom: 0;
  justify-content: flex-start;
}

.filter-panel .quick-actions button {
  flex: 0 0 auto;
  min-width: 150px;
  width: auto;
}

/* =========================================================
   BOTÕES
   ========================================================= */

button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  min-height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: .18s ease;
  font-family: inherit;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.table-action-btn,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.primary-btn {
  background: var(--primary-2);
  color: #fff;
  border: none;
}

.primary-btn:hover {
  background: var(--primary-2-hover);
}

.secondary-btn {
  background: #fff;
  color: var(--text);
}

.danger-btn,
.danger-outline {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff;
}

.danger-btn:hover,
.danger-outline:hover {
  background: #fff1f2;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.quick-actions button {
  flex: 0 0 auto;
  min-width: 140px;
  width: auto;
}

.page-header .quick-actions button,
.page-header-row .quick-actions button,
.list-header .quick-actions button,
.status-bar .quick-actions button,
.form-actions button {
  flex: 0 0 auto;
  min-width: 140px;
  width: auto;
}

/* =========================================================
   TABELAS
   ========================================================= */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
}

.table-wrap-featured {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-xs);
  table-layout: auto;
}

.table-featured {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

thead,
.table-featured thead {
  background: #fbfcfe;
}

.table-featured thead {
  background: #f8fafc;
}

th {
  text-align: left;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

td {
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 15px;
  vertical-align: middle;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background .15s ease;
}

.table-featured th {
  padding: 20px;
  font-size: 13px;
  letter-spacing: .01em;
}

.table-featured td {
  padding: 20px;
  font-size: 14px;
}

.table-featured tbody tr:hover td,
.clickable-row:hover td {
  background: #fafcff;
}

.clickable-row {
  cursor: pointer;
  transition: background .15s ease;
}

tr.selected {
  background: #e9f0ff !important;
}

tr.selected td {
  border-color: #bfdbfe;
}

td .action-buttons,
td .quick-actions,
td .table-actions {
  white-space: nowrap;
  overflow: visible;
}

.table-actions,
.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow: visible;
}

.action-buttons {
  flex-wrap: nowrap;
}

.action-buttons button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.table-action-btn {
  min-width: unset;
  width: auto;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.table-action-btn.danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}

.table-action-btn.danger:hover {
  background: #fff1f2;
}

.table-subtext {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 4px;
}

.text-center {
  text-align: center;
}

.empty-cell,
.empty-box {
  padding: 18px;
  color: #64748b;
  text-align: center;
}

.empty-state {
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--text-soft);
  background: #fff;
  padding: 24px;
  text-align: center;
}

td.empty-state {
  display: table-cell;
  min-height: unset;
  border: none;
  border-radius: 0;
}

.row-warning {
  background: #fff7ed;
}


/* =========================================================
   STATUS / BADGES
   ========================================================= */

.badge,
.status-badge,
.license-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.badge {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge {
  min-height: 26px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-admin,
.status-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-active,
.status-aprovado,
.status-badge.success {
  background: var(--success-soft);
  color: #166534;
}

.badge-inactive,
.status-cancelado,
.status-badge.danger {
  background: var(--danger-soft);
  color: #991b1b;
}

.badge-pending,
.status-pendente,
.status-badge.warning {
  background: var(--warning-soft);
  color: #92400e;
}

.status-badge.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.muted,
.status-neutro {
  background: #f1f5f9;
  color: #64748b;
}

.status-em-andamento {
  color: #5b21b6;
  background: #ede9fe;
}

.status-alerta {
  color: #9a3412;
  background: #ffedd5;
}

/* =========================================================
   STATUS BAR
   ========================================================= */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.container .status-bar {
  margin-top: 18px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22,163,74,.10);
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef3fb 0%, #f8fafc 100%);
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  width: 100%;
}

.login-logo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.login-title {
  text-align: center;
  margin-bottom: 24px;
}

.login-title h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.login-title p {
  margin: 0;
  color: var(--text-soft);
}

.flash-message {
  min-height: 24px;
  margin-bottom: 16px;
  color: var(--danger);
  font-size: 14px;
  text-align: center;
}

/* =========================================================
   AVATAR / DROPDOWN
   ========================================================= */

.avatar-menu {
  position: relative;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
}

.dropdown {
  position: absolute;
  top: 56px;
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  padding: 10px;
  z-index: 1500;
}

.dropdown a {
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
}

.dropdown a:hover {
  background: #f8fafc;
}

.user-mini-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}

.user-mini-name {
  font-weight: 800;
  color: var(--text);
}

.user-mini-license {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* =========================================================
   MÓDULOS / HOME
   ========================================================= */

.module-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.module-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-2-hover);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.module-description {
  margin: 0;
  color: var(--text-soft);
  max-width: 720px;
}

.permission-card {
  display: none;
}

.quick-grid,
.module-grid,
.modules-grid {
  display: grid;
  gap: 14px;
}

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

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

.modules-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.quick-card,
.module-card,
.module-grid .module-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: .18s ease;
  width: 100%;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.quick-card {
  min-height: 140px;
}

.module-card,
.module-grid .module-card {
  min-height: 150px;
}

.quick-card:hover,
.module-card:hover,
.module-grid .module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-2);
}

.module-card:disabled,
.module-card.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.quick-card-title,
.module-card-title,
.module-grid .module-card strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.quick-card-text,
.module-card-text,
.module-grid .module-card small {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.module-card-top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef4ff;
  color: #2563eb;
  border: 1px solid #d9e7ff;
  margin-top: 8px;
}

.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--primary-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1px solid #d9e7ff;
}

/* =========================================================
   PROFILE / DETALHES
   ========================================================= */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-xs);
}

.profile-card h3 {
  margin: 0 0 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  min-height: 86px;
  justify-content: center;
}

.detail-item strong {
  font-size: 13px;
  color: var(--text-soft);
}

.detail-item span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

/* =========================================================
   MODAIS / TOAST
   ========================================================= */

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  z-index: 5000;
  box-shadow: 0 18px 40px rgba(15,23,42,.18);
  border-left: 6px solid transparent;
  opacity: 1;
  transition: opacity .25s ease, transform .25s ease;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-6px);
}

.toast-success {
  background: #16a34a;
  border-left-color: #14532d;
}

.toast-error {
  background: #dc2626;
  border-left-color: #7f1d1d;
}

.toast-warning {
  background: #d97706;
  border-left-color: #78350f;
}

.toast-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 14px;
  line-height: 1.4;
}

.modal-overlay,
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 4000;
}

.app-modal-backdrop {
  z-index: 9999;
  padding: 24px;
}

.modal-overlay.hidden,
.hidden {
  display: none !important;
}

.modal-card,
.app-modal {
  width: 100%;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-card {
  max-width: 760px;
  padding: 24px;
}

.modal-card-lg {
  max-width: 980px;
}

.app-modal {
  max-width: 480px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.app-modal-header {
  padding: 20px 24px 8px;
}

.app-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.app-modal-body {
  padding: 0 24px 20px;
  color: var(--text-soft);
  line-height: 1.55;
}

.app-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 24px 24px;
}

/* =========================================================
   LISTAS / TOOLBARS
   ========================================================= */

.list-header,
.license-selection-header,
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.list-header {
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
}

.section-title-row h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.section-title-row p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.table-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.list-header-strong {
  margin-bottom: 18px;
}

.section-title-table {
  font-size: 24px;
}

.table-description {
  font-size: 15px;
}

.quick-actions-table button {
  min-width: 210px;
}

/* =========================================================
   ABAS
   ========================================================= */

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  padding-bottom: 10px;
}

.tab-btn {
  flex: 0 0 auto;
  min-width: unset;
  width: auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0 16px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 800;
}

.tab-btn:hover {
  background: #f8fafc;
}

.tab-btn.active {
  background: var(--primary-2);
  border-color: var(--primary-2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,.18);
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

/* =========================================================
   RECORD SUMMARY
   ========================================================= */

.record-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.record-summary > div {
  padding: 14px 16px;
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  background: #f8fafc;
}

.summary-label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.record-summary strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   TIMELINE
   ========================================================= */

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: flex-start;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-2);
  margin-top: 7px;
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.timeline-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.timeline-title strong {
  color: var(--text);
  font-size: 14px;
}

.timeline-title span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.timeline-content p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.timeline-content small {
  color: var(--text-soft);
  font-size: 12px;
}

/* =========================================================
   FINANCEIRO
   ========================================================= */

.financeiro-bloco-tipo {
  grid-column: 1 / -1;
}

.financeiro-bloco-tipo .subcard {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
}

.financeiro-bloco-tipo.hidden,
.subcard.hidden {
  display: none !important;
}

/* =========================================================
   DATAJUD
   ========================================================= */

.datajud-warning {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 13px;
  font-weight: 600;
}

.datajud-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
}

.datajud-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.datajud-summary-item {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  min-height: 78px;
}

.datajud-summary-item small {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.datajud-summary-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.datajud-summary-item.wide {
  grid-column: span 2;
}

.movimento-complementos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.movimento-complemento {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* =========================================================
   LICENÇAS
   ========================================================= */

.license-selection-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  background: #fbfcff;
  border-radius: 22px;
  padding: 18px;
}

.license-selection-box h4,
.license-selection-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.subscription-total-box {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid #dbe7f5;
  background: #f8fbff;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
}

.licenses-grouped-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.license-module-group {
  border: 1px solid #e5eaf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.license-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.license-module-header:hover {
  background: #f8fbff;
}

.license-module-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.license-module-toggle {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #2563eb;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .18s ease;
}

.license-module-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.license-module-meta,
.license-module-summary {
  font-size: 13px;
  color: var(--text-soft);
}

.license-module-summary {
  font-weight: 700;
}

.license-module-body {
  padding: 0 18px 18px;
  display: block;
}

.license-module-group.collapsed .license-module-body {
  display: none;
}

.license-module-group.collapsed .license-module-toggle {
  transform: rotate(-90deg);
}

.license-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.license-card {
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.license-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.license-card-subtitle {
  font-size: 13px;
  color: var(--text-soft);
}

.license-pill {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.license-pill-admin {
  background: #dbeafe;
  color: #1d4ed8;
}

.license-pill-user {
  background: #ecfdf3;
  color: #15803d;
}

.license-card-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.license-price-main {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.license-price-cycle {
  font-size: 12px;
  color: var(--text-soft);
}

.license-card-controls {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: end;
}

.license-qty-box,
.license-subtotal-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.license-qty-box label,
.license-subtotal-box label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.license-qty-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.license-subtotal-value {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-weight: 800;
  color: var(--text);
}

.license-empty-state {
  border: 1px dashed #d6dce6;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  color: var(--text-soft);
  background: #fff;
}

/* =========================================================
   JURÍDICO / INTRO
   ========================================================= */

.access-chip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-xs);
}

.access-chip-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.access-chip-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.legal-intro-panel {
  margin-bottom: 16px;
}

.legal-intro-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.legal-intro-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.legal-intro-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* =========================================================
   CRM / TABELA AUXILIAR
   ========================================================= */

.cell-main {
  font-weight: 600;
  color: var(--text);
}

.cell-muted {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-soft);
}

/* =========================================================
   HELPERS
   ========================================================= */

.hidden {
  display: none !important;
}

.full {
  grid-column: 1 / -1;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

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

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

  .datajud-summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 1100px) {
  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar-content {
    flex-wrap: wrap;
    padding: 14px 18px;
  }

  .logo {
    min-width: auto;
  }

  .menu-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .user-area {
    min-width: auto;
    width: auto;
  }

  .form-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .profile-grid,
  .detail-grid,
  .dashboard-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

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

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

  .page-header-row,
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-actions-table {
    width: 100%;
  }

  .quick-actions-table button {
    min-width: unset;
    flex: 1 1 220px;
  }

  .container-flat {
    padding: 16px 18px;
  }

  .container-table-focus {
    padding: 20px 18px 22px;
  }

  .modal-card {
    padding: 18px;
    border-radius: 18px;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 12px;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  .filter-panel .quick-actions button,
  .page-header .quick-actions button,
  .page-header-row .quick-actions button,
  .list-header .quick-actions button,
  .status-bar .quick-actions button,
  .form-actions button {
    width: 100%;
    min-width: unset;
    flex: 1 1 100%;
  }

  .datajud-summary-grid {
    grid-template-columns: 1fr;
  }

  .datajud-summary-item.wide {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .dashboard,
  .quick-grid,
  .modules-grid,
  .record-summary {
    grid-template-columns: 1fr;
  }

  .container {
    width: 94vw;
    padding: 18px;
    border-radius: 18px;
  }

  .page-header,
  .dashboard,
  .dashboard-grid {
    width: 94vw;
  }

  .page-header h1 {
    font-size: 32px;
  }

  .status-time {
    font-size: 13px;
    padding: 8px 12px;
  }

  .dropdown {
    right: auto;
    left: 0;
    min-width: 230px;
  }

  .login-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .metric-value,
  .metric-card strong {
    font-size: 28px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .license-card-controls {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   CORREÇÃO: DASHBOARD-GRID DENTRO DE CONTAINER
   ========================================================= */

.container .dashboard-grid,
.form-card .dashboard-grid {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.container .metric-card,
.form-card .metric-card {
  width: 100%;
}

/* =========================================================
   AJUSTE GLOBAL - ESPAÇAMENTO ENTRE CAMPOS
   ========================================================= */

.form-grid {
  row-gap: 50px;
  column-gap: 16px;
}

.form-group,
.form-field {
  gap: 5px;
}

.form-group label,
.form-field label {
  margin-bottom: 2px;
}

.form-grid + .form-grid {
  margin-top: 15px;
}

/* =========================================================
   CRM — Ajustes de grade dos formulários
   Mantém o padrão visual existente, mas permite campos
   ocuparem 2, 3 ou 4 colunas quando necessário.
========================================================= */

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: span 3;
}

.form-grid .span-4 {
  grid-column: 1 / -1;
}

.form-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
}

@media (max-width: 1100px) {
  .form-grid .span-2,
  .form-grid .span-3,
  .form-grid .span-4 {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   CRM — OPORTUNIDADES / FUNIL
   Incremental: mantém identidade visual atual e adiciona somente
   componentes necessários para a visão Kanban.
========================================================= */

.crm-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.crm-kanban-column {
  background: var(--surface-soft, #f8fafc);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  padding: 14px;
  min-height: 360px;
}

.crm-kanban-column-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.crm-kanban-column-header strong {
  display: block;
  font-size: 15px;
}

.crm-kanban-column-header small,
.crm-kanban-column-header span {
  display: block;
  color: var(--text-soft, #64748b);
  font-size: 12px;
  margin-top: 4px;
}

.crm-kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-kanban-card {
  width: 100%;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  background: var(--surface, #ffffff);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.crm-kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.crm-kanban-card strong,
.crm-kanban-card span {
  display: block;
}

.crm-kanban-card strong {
  color: var(--text-main, #111827);
  font-size: 14px;
  margin-bottom: 6px;
}

.crm-kanban-card > span {
  color: var(--text-soft, #64748b);
  font-size: 13px;
}

.crm-kanban-card-footer,
.crm-kanban-card-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.crm-kanban-card-footer small {
  color: var(--text-soft, #64748b);
  font-size: 12px;
}

.crm-kanban-empty {
  border: 1px dashed var(--border-color, #e5e7eb);
  border-radius: 14px;
  color: var(--text-soft, #64748b);
  font-size: 13px;
  padding: 14px;
  text-align: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface, #ffffff);
}

.history-item strong,
.history-item span,
.history-item small {
  display: block;
}

.history-item strong {
  margin-bottom: 4px;
}

.history-item span,
.history-item small {
  color: var(--text-soft, #64748b);
  font-size: 13px;
}

.history-item small {
  margin-top: 6px;
}

/* =========================================================
   CRM — IMPRESSÃO DE PROPOSTA / ORÇAMENTO
========================================================= */

.print-page-body {
  background: #eef2f7;
}

.proposal-print-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px;
}

.proposal-print-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.proposal-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow-soft);
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.proposal-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.proposal-brand img {
  width: 84px;
  max-height: 64px;
  object-fit: contain;
}

.proposal-brand h1 {
  margin: 0;
  font-size: 26px;
  color: var(--text);
}

.proposal-brand p,
.proposal-footer p {
  margin: 4px 0 0;
  color: var(--text-soft);
}

.proposal-status {
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.proposal-section {
  margin-top: 24px;
}

.proposal-section h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--text);
}

.proposal-section p {
  margin: 4px 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.proposal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.proposal-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.proposal-table th,
.proposal-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.proposal-table th {
  background: #f8fafc;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.proposal-totals-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.proposal-notes {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  min-height: 136px;
}

.proposal-totals {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.proposal-totals div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.proposal-totals div:last-child {
  border-bottom: 0;
}

.proposal-total-final {
  background: #f8fafc;
  font-size: 18px;
}

.proposal-footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 14px;
  text-align: center;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body.print-page-body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .proposal-print-page {
    max-width: none;
    padding: 0;
  }

  .proposal-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .proposal-header,
  .proposal-table th,
  .proposal-table td,
  .proposal-totals div,
  .proposal-footer {
    break-inside: avoid;
  }
}

@media (max-width: 760px) {
  .proposal-grid-2,
  .proposal-totals-wrap {
    grid-template-columns: 1fr;
  }

  .proposal-header {
    flex-direction: column;
  }

  .proposal-sheet {
    padding: 22px;
  }
}

/* =========================================================
   HOTFIX CRM — IMPRESSÃO DE PROPOSTA: TABELA DENTRO DA PÁGINA
========================================================= */

.proposal-table {
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.proposal-table th,
.proposal-table td {
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.proposal-table th:nth-child(1),
.proposal-table td:nth-child(1) {
  width: 11%;
}

.proposal-table th:nth-child(2),
.proposal-table td:nth-child(2) {
  width: 37%;
}

.proposal-table th:nth-child(3),
.proposal-table td:nth-child(3) {
  width: 8%;
  text-align: center;
}

.proposal-table th:nth-child(4),
.proposal-table td:nth-child(4),
.proposal-table th:nth-child(5),
.proposal-table td:nth-child(5),
.proposal-table th:nth-child(6),
.proposal-table td:nth-child(6) {
  width: 14.6%;
  text-align: right;
}

@media print {
  .proposal-table {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
    font-size: 11px;
  }

  .proposal-table th,
  .proposal-table td {
    padding: 8px 6px;
  }
}

/* =========================================================
   CRM - ANEXOS / HISTÓRICO VISUAL
========================================================= */

.crm-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.crm-section-header h3 {
  margin-bottom: 6px;
}

.crm-section-header p {
  margin: 0;
  color: #51627a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.crm-attachments-card {
  margin-bottom: 18px;
}

.crm-attachment-upload-grid {
  align-items: end;
}

.compact-actions {
  margin-top: 12px;
  margin-bottom: 0;
  justify-content: flex-start;
}

.crm-attachments-panel input[type="file"] {
  min-height: 48px;
  padding-top: 12px;
}

/* =========================================================
   CRM — Relatórios e configurações
========================================================= */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.report-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
}

.report-card h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

.compact-table table {
  min-width: 0;
  width: 100%;
}

.compact-table th,
.compact-table td {
  padding: 11px 12px;
  white-space: normal;
}

.no-print {
  display: block;
}

@media print {
  .topbar,
  .app-sidebar,
  .no-print,
  .quick-actions {
    display: none !important;
  }

  .main-content.with-sidebar {
    margin: 0 !important;
    padding: 0 !important;
  }

  .printable-report,
  .container {
    box-shadow: none !important;
    border: 0 !important;
    padding: 12px 0 !important;
    margin: 0 0 14px !important;
  }

  .report-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}


.crm-settings-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.crm-settings-page-simple {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.crm-settings-accordion-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 35, 95, 0.05);
  overflow: hidden;
}

.crm-settings-accordion-header {
  width: 100%;
  border: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  text-align: left;
}

.crm-settings-accordion-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.crm-settings-accordion-title-wrap h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.crm-settings-accordion-title-wrap p {
  margin: 0;
  color: #51627a;
  line-height: 1.5;
}

.crm-settings-accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 107, 255, 0.10);
  color: #2f6bff;
  font-size: 0.95rem;
  margin-top: 2px;
  transition: transform 0.2s ease;
}

.crm-settings-accordion-item.expanded .crm-settings-accordion-icon {
  transform: rotate(0deg);
}

.crm-settings-accordion-item:not(.expanded) .crm-settings-accordion-icon {
  transform: rotate(-90deg);
}

.crm-settings-accordion-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.crm-settings-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(47, 107, 255, 0.10);
  color: #2f6bff;
  font-weight: 700;
  font-size: 0.86rem;
}

.crm-settings-counter-pill.subtle {
  background: #f2f5fa;
  color: #51627a;
}

.crm-settings-accordion-content {
  display: none;
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
}

.crm-settings-accordion-item.expanded .crm-settings-accordion-content {
  display: block;
}

.crm-settings-type-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  margin-bottom: 18px;
}

.crm-settings-type-group-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #42526b;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-settings-type-group-btn:hover,
.crm-settings-type-group-btn.active {
  background: rgba(47, 107, 255, 0.10);
  border-color: rgba(47, 107, 255, 0.28);
  color: #2f6bff;
}

.crm-settings-block-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crm-settings-editor-card,
.crm-settings-content-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

.crm-settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.crm-settings-card-header h3 {
  margin-bottom: 4px;
}

.crm-settings-card-header p {
  margin: 0;
  color: #51627a;
  line-height: 1.5;
}

.crm-settings-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  padding-top: 4px;
}

.crm-settings-filter-panel {
  margin-bottom: 14px;
}

.crm-settings-table-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.crm-settings-table-main small {
  color: #6b7a90;
}

@media (max-width: 1180px) {
  .crm-settings-block-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .crm-settings-accordion-header {
    flex-direction: column;
    align-items: stretch;
  }

  .crm-settings-accordion-meta {
    justify-content: flex-start;
  }
}


/* =========================================================
   CRM — Relatórios refinados
========================================================= */
.crm-report-filter-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crm-report-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.crm-report-filter-header h2 {
  margin: 0 0 4px;
}

.crm-report-filter-header p {
  margin: 0;
  color: #51627a;
  line-height: 1.45;
}

.crm-report-period-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.crm-report-filter-panel {
  margin-bottom: 0;
}

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

.crm-report-accordion {
  padding: 0;
  overflow: hidden;
}

.crm-report-section-header {
  width: 100%;
  border: 0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.crm-report-section-header h2 {
  margin: 0 0 4px;
}

.crm-report-section-header p {
  margin: 0;
  color: #51627a;
  line-height: 1.45;
}

.crm-report-section-content {
  display: none;
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px;
}

.crm-report-accordion.expanded .crm-report-section-content {
  display: block;
}

.crm-report-accordion:not(.expanded) .crm-settings-accordion-icon {
  transform: rotate(-90deg);
}

.crm-report-table-label {
  display: grid;
  gap: 6px;
}

.crm-report-table-label span {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.22);
}

@media (max-width: 980px) {
  .crm-report-filter-header {
    flex-direction: column;
  }

  .crm-report-period-shortcuts {
    justify-content: flex-start;
  }

  .crm-report-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .crm-report-accordion .crm-report-section-content {
    display: block !important;
    padding: 12px 0 0 !important;
  }

  .crm-report-section-header {
    padding: 0 0 8px !important;
  }

  .crm-report-section-header .crm-settings-accordion-icon {
    display: none !important;
  }
}


/* =========================================================
   CRM — KANBAN ARRASTAR E SOLTAR
========================================================= */
.crm-kanban {
  display: block;
  overflow: visible;
  padding-bottom: 0;
}

.crm-kanban-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  background: #fff;
}

.crm-kanban-toolbar strong,
.crm-kanban-toolbar small,
.crm-kanban-toolbar span {
  display: block;
}

.crm-kanban-toolbar small,
.crm-kanban-toolbar span {
  color: var(--text-soft, #64748b);
  font-size: 13px;
  margin-top: 4px;
}

.crm-kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(285px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.crm-kanban-column {
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.crm-kanban-column.drop-target {
  border-color: rgba(47, 107, 255, 0.55);
  background: rgba(47, 107, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, 0.18);
}

.crm-kanban-cards {
  min-height: 260px;
}

.crm-kanban-card {
  user-select: none;
}

.crm-kanban-card.dragging {
  opacity: 0.55;
  transform: rotate(1deg) scale(0.98);
  cursor: grabbing;
}

.crm-kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.crm-kanban-card-head strong {
  margin-bottom: 0;
}

.crm-kanban-card-head small {
  color: var(--text-soft, #64748b);
  font-size: 11px;
  white-space: nowrap;
}

.crm-kanban-card-tags small {
  color: var(--text-soft, #64748b);
  font-size: 12px;
}

.secondary-btn.active-view {
  background: rgba(47, 107, 255, 0.10);
  border-color: rgba(47, 107, 255, 0.28);
  color: var(--primary, #2f6bff);
}

@media (max-width: 900px) {
  .crm-kanban-toolbar {
    flex-direction: column;
  }
}


/* =========================================================
   CRM — Registros vinculados
========================================================= */
.linked-record-box {
  margin-top: 16px;
}

.linked-record-card,
.linked-record-empty {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.linked-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.linked-record-card strong,
.linked-record-empty strong {
  display: block;
  color: #0b1f44;
  margin-bottom: 4px;
}

.linked-record-card span,
.linked-record-empty span {
  display: block;
  color: #51627a;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .linked-record-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.linked-record-card-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.95), #fff);
}

.locked-record-summary {
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.85), #fff) !important;
}

/* =========================================================
   CRM - HISTÓRICO CONSOLIDADO DO FLUXO
========================================================= */
.crm-flow-history-card {
  margin-top: 18px;
}

.crm-flow-history-card table {
  min-width: 0;
  width: 100%;
}

.crm-flow-history-card th,
.crm-flow-history-card td {
  white-space: normal;
  vertical-align: top;
}

/* =========================================================
   CRM — Pedidos / acompanhamento operacional
========================================================= */
.crm-order-ops-card {
  margin-top: 18px;
}

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

.crm-order-ops-metric {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-order-ops-metric span {
  display: block;
  color: #6b7a90;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-order-ops-metric strong {
  color: #0b1f44;
  font-size: 1.25rem;
  line-height: 1.2;
}

.crm-order-ops-metric small {
  color: #51627a;
  line-height: 1.35;
}

.crm-order-status-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-status-btn.active {
  background: rgba(47, 107, 255, 0.12);
  border-color: rgba(47, 107, 255, 0.35);
  color: #2f6bff;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .crm-order-ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .crm-order-ops-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   TOPBAR PADRONIZADA
========================================================= */
.logo {
  cursor: pointer;
}

.logo:hover img {
  opacity: .92;
}

.topbar-content .menu-center {
  display: none !important;
}


/* =========================================================
   COMPRAS — Ajustes visuais incrementais
   Mantém o padrão usado em CRM/Financeiro, com campos mais
   proporcionais ao conteúdo de cada tela.
========================================================= */

body[data-page^="compras"] .container,
body[data-page="solicitacoes"] .container,
body[data-page="cotacoes"] .container,
body[data-page="pedidos"] .container,
body[data-page="fornecedores"] .container,
body[data-page="itens"] .container {
  border-radius: 24px;
}

body[data-page^="compras"] .module-grid,
body[data-page="compras"] .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}

body[data-page^="compras"] .module-card,
body[data-page="compras"] .module-card {
  min-height: 168px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 22px;
}

body[data-page^="compras"] .module-card h3,
body[data-page="compras"] .module-card h3 {
  margin: 8px 0 6px;
  font-size: 18px;
  color: var(--text);
}

body[data-page^="compras"] .module-card p,
body[data-page="compras"] .module-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

body[data-page^="compras"] .module-icon,
body[data-page="compras"] .module-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 20px;
}

body[data-page="solicitacoes"] #formFields,
body[data-page="cotacoes"] #formFields,
body[data-page="pedidos"] #formFields,
body[data-page="fornecedores"] #formFields,
body[data-page="itens"] #formFields {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 18px;
}

body[data-page="solicitacoes"] #formFields .form-field,
body[data-page="cotacoes"] #formFields .form-field,
body[data-page="pedidos"] #formFields .form-field,
body[data-page="fornecedores"] #formFields .form-field,
body[data-page="itens"] #formFields .form-field {
  grid-column: span 4;
}

.form-field.full-width,
.form-field.span-2.full-width,
body[data-page="solicitacoes"] #formFields .purchase-field-full,
body[data-page="cotacoes"] #formFields .purchase-field-full,
body[data-page="pedidos"] #formFields .purchase-field-full,
body[data-page="fornecedores"] #formFields .purchase-field-full,
body[data-page="itens"] #formFields .purchase-field-full {
  grid-column: 1 / -1;
}

body[data-page="solicitacoes"] #formFields .purchase-field-xl,
body[data-page="cotacoes"] #formFields .purchase-field-xl,
body[data-page="pedidos"] #formFields .purchase-field-xl,
body[data-page="fornecedores"] #formFields .purchase-field-xl,
body[data-page="itens"] #formFields .purchase-field-xl {
  grid-column: span 8;
}

body[data-page="solicitacoes"] #formFields .purchase-field-lg,
body[data-page="cotacoes"] #formFields .purchase-field-lg,
body[data-page="pedidos"] #formFields .purchase-field-lg,
body[data-page="fornecedores"] #formFields .purchase-field-lg,
body[data-page="itens"] #formFields .purchase-field-lg {
  grid-column: span 6;
}

body[data-page="solicitacoes"] #formFields .purchase-field-md,
body[data-page="cotacoes"] #formFields .purchase-field-md,
body[data-page="pedidos"] #formFields .purchase-field-md,
body[data-page="fornecedores"] #formFields .purchase-field-md,
body[data-page="itens"] #formFields .purchase-field-md {
  grid-column: span 4;
}

body[data-page="solicitacoes"] #formFields .purchase-field-sm,
body[data-page="cotacoes"] #formFields .purchase-field-sm,
body[data-page="pedidos"] #formFields .purchase-field-sm,
body[data-page="fornecedores"] #formFields .purchase-field-sm,
body[data-page="itens"] #formFields .purchase-field-sm {
  grid-column: span 3;
}

body[data-page="solicitacoes"] #formFields .purchase-field-xs,
body[data-page="cotacoes"] #formFields .purchase-field-xs,
body[data-page="pedidos"] #formFields .purchase-field-xs,
body[data-page="fornecedores"] #formFields .purchase-field-xs,
body[data-page="itens"] #formFields .purchase-field-xs {
  grid-column: span 2;
}

.filters-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, max-content) 150px 150px auto;
  gap: 12px;
  align-items: end;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 18px;
}

.filters-row input,
.filters-row select {
  min-height: 42px;
}

.filters-row .secondary-btn {
  min-width: 118px;
  width: fit-content;
  justify-self: end;
}

body[data-page="solicitacoes"] #formCadastro,
body[data-page="cotacoes"] #formCadastro,
body[data-page="pedidos"] #formCadastro,
body[data-page="fornecedores"] #formCadastro,
body[data-page="itens"] #formCadastro {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 20px;
}

body[data-page="solicitacoes"] #formCadastro .table-responsive,
body[data-page="cotacoes"] #formCadastro .table-responsive,
body[data-page="pedidos"] #formCadastro .table-responsive {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow: auto;
}

body[data-page^="compras"] .data-table input,
body[data-page^="compras"] .data-table select,
body[data-page^="compras"] .data-table textarea,
body[data-page="solicitacoes"] .data-table input,
body[data-page="solicitacoes"] .data-table select,
body[data-page="cotacoes"] .data-table input,
body[data-page="cotacoes"] .data-table select,
body[data-page="pedidos"] .data-table input,
body[data-page="pedidos"] .data-table select {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
}

body[data-page="solicitacoes"] .data-table input[type="number"],
body[data-page="cotacoes"] .data-table input[type="number"],
body[data-page="pedidos"] .data-table input[type="number"] {
  max-width: 120px;
}

body[data-page="solicitacoes"] .data-table td:nth-child(2),
body[data-page="cotacoes"] .data-table td:nth-child(2),
body[data-page="pedidos"] .data-table td:nth-child(2),
body[data-page="solicitacoes"] .data-table td:nth-child(3),
body[data-page="cotacoes"] .data-table td:nth-child(3),
body[data-page="pedidos"] .data-table td:nth-child(3),
body[data-page="solicitacoes"] .data-table td:nth-child(4),
body[data-page="cotacoes"] .data-table td:nth-child(4),
body[data-page="pedidos"] .data-table td:nth-child(4) {
  width: 120px;
  white-space: nowrap;
}

body[data-page="solicitacoes"] .data-table td:first-child input,
body[data-page="cotacoes"] .data-table td:first-child input,
body[data-page="pedidos"] .data-table td:first-child input {
  min-width: 260px;
}

.purchase-settings-type-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 18px;
}

.purchase-settings-type-card {
  border-top: 1px solid var(--border-soft);
  padding-top: 18px;
}

.purchase-settings-type-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.purchase-settings-description {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 14px;
}

.purchase-settings-table-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.purchase-settings-table-title h3 {
  margin: 0 0 4px;
}

.purchase-settings-table-title small {
  color: var(--text-soft);
}

body[data-page="compras-configuracoes"] .crm-settings-editor-card .form-grid,
body[data-page="compras-configuracoes"] .form-card .form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  row-gap: 16px;
}

body[data-page="compras-configuracoes"] .form-card .purchase-field-option-name { grid-column: span 5; }
body[data-page="compras-configuracoes"] .form-card .purchase-field-option-value { grid-column: span 5; }
body[data-page="compras-configuracoes"] .form-card .purchase-field-option-order { grid-column: span 2; }
body[data-page="compras-configuracoes"] .form-card .purchase-field-option-description { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  body[data-page="solicitacoes"] #formFields .purchase-field-xs,
  body[data-page="cotacoes"] #formFields .purchase-field-xs,
  body[data-page="pedidos"] #formFields .purchase-field-xs,
  body[data-page="fornecedores"] #formFields .purchase-field-xs,
  body[data-page="itens"] #formFields .purchase-field-xs,
  body[data-page="solicitacoes"] #formFields .purchase-field-sm,
  body[data-page="cotacoes"] #formFields .purchase-field-sm,
  body[data-page="pedidos"] #formFields .purchase-field-sm,
  body[data-page="fornecedores"] #formFields .purchase-field-sm,
  body[data-page="itens"] #formFields .purchase-field-sm {
    grid-column: span 4;
  }

  body[data-page="solicitacoes"] #formFields .purchase-field-xl,
  body[data-page="cotacoes"] #formFields .purchase-field-xl,
  body[data-page="pedidos"] #formFields .purchase-field-xl,
  body[data-page="fornecedores"] #formFields .purchase-field-xl,
  body[data-page="itens"] #formFields .purchase-field-xl,
  body[data-page="solicitacoes"] #formFields .purchase-field-lg,
  body[data-page="cotacoes"] #formFields .purchase-field-lg,
  body[data-page="pedidos"] #formFields .purchase-field-lg,
  body[data-page="fornecedores"] #formFields .purchase-field-lg,
  body[data-page="itens"] #formFields .purchase-field-lg {
    grid-column: span 6;
  }
}

@media (max-width: 1050px) {
  .filters-row {
    grid-template-columns: 1fr 1fr;
  }

  .filters-row .secondary-btn {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .filters-row,
  body[data-page="solicitacoes"] #formFields,
  body[data-page="cotacoes"] #formFields,
  body[data-page="pedidos"] #formFields,
  body[data-page="fornecedores"] #formFields,
  body[data-page="itens"] #formFields,
  body[data-page="compras-configuracoes"] .form-card .form-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="solicitacoes"] #formFields .form-field,
  body[data-page="cotacoes"] #formFields .form-field,
  body[data-page="pedidos"] #formFields .form-field,
  body[data-page="fornecedores"] #formFields .form-field,
  body[data-page="itens"] #formFields .form-field,
  body[data-page="compras-configuracoes"] .form-card .form-field {
    grid-column: 1 / -1 !important;
  }

  body[data-page^="compras"] .module-card,
  body[data-page="compras"] .module-card {
    min-height: 150px;
  }
}

/* Compras — fluxo de aprovação, anexos e histórico */
body[data-page="compras-aprovacoes"] .container {
  border-radius: 24px;
}

body[data-page="compras-aprovacoes"] .compras-approval-metrics {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body[data-page="compras-aprovacoes"] .table-actions,
body[data-page="solicitacoes"] .table-actions,
body[data-page="cotacoes"] .table-actions,
body[data-page="pedidos"] .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.purchase-support-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.purchase-support-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 18px;
}

.purchase-support-card .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-support-card .table-responsive {
  margin-top: 12px;
}

body[data-page="solicitacoes"] #formFields .purchase-field-md,
body[data-page="cotacoes"] #formFields .purchase-field-md,
body[data-page="pedidos"] #formFields .purchase-field-md {
  min-width: 0;
}

@media (max-width: 900px) {
  .purchase-support-card .form-grid {
    grid-template-columns: 1fr;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .filters-row .secondary-btn {
    justify-self: stretch;
    width: 100%;
  }
}

/* Compras — fluxo lógico solicitação > cotação > pedido */
.purchase-flow-panel {
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background: #fff;
  padding: 18px;
}

body[data-page="solicitacoes"] #itemsBody select,
body[data-page="cotacoes"] #itemsBody select,
body[data-page="pedidos"] #itemsBody select {
  min-width: 190px;
}

body[data-page="solicitacoes"] #itemsBody input[type="number"] {
  max-width: 120px;
}

body[data-page="cotacoes"] #itemsBody input[type="number"],
body[data-page="pedidos"] #itemsBody input[type="number"] {
  max-width: 130px;
}

body[data-page="solicitacoes"] #formFields input[name="solicitante"],
body[data-page="solicitacoes"] #formFields select[name="departamento"] {
  background: #f8fafc;
}

/* =========================================================
   Compras - ajustes de moeda, cotações e comparativo
========================================================= */
.purchase-money-input,
.purchase-qty-input {
  min-width: 110px;
  max-width: 150px;
  text-align: right;
}

.purchase-comparison-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.purchase-comparison-summary > div {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-color, #fff);
}

.purchase-comparison-summary span {
  display: block;
  font-size: 12px;
  color: var(--text-soft, #64748b);
  margin-bottom: 4px;
}

.purchase-comparison-summary strong {
  font-size: 18px;
  color: var(--text-color, #0f172a);
}

.purchase-best-quote {
  background: rgba(22, 163, 74, 0.08);
}

.purchase-best-quote small,
.purchase-best-quote-card h4::after {
  color: #15803d;
  font-weight: 700;
}

.purchase-quote-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.purchase-quote-detail-card {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface-color, #fff);
}

.purchase-quote-detail-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.purchase-best-quote-card {
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.08);
}

.purchase-best-quote-card h4::after {
  content: "  • menor valor";
  font-size: 12px;
}

.purchase-approval-comparison {
  scroll-margin-top: 90px;
}

/* =========================================================
   Compras - solicitação com cotações agrupadas
========================================================= */
body[data-page="cotacoes"] #listArea > .table-responsive {
  display: none;
}

body[data-page="solicitacoes"] #itemsBody,
body[data-page="cotacoes"] #itemsBody,
body[data-page="pedidos"] #itemsBody {
  vertical-align: middle;
}

body[data-page="solicitacoes"] #itemsBody .pur-col-item,
body[data-page="cotacoes"] #itemsBody .pur-col-item,
body[data-page="pedidos"] #itemsBody .pur-col-item,
body[data-page="solicitacoes"] th.pur-col-item,
body[data-page="cotacoes"] th.pur-col-item,
body[data-page="pedidos"] th.pur-col-item {
  width: 24%;
  min-width: 220px;
}

body[data-page="solicitacoes"] #itemsBody .pur-col-desc,
body[data-page="cotacoes"] #itemsBody .pur-col-desc,
body[data-page="pedidos"] #itemsBody .pur-col-desc,
body[data-page="solicitacoes"] th.pur-col-desc,
body[data-page="cotacoes"] th.pur-col-desc,
body[data-page="pedidos"] th.pur-col-desc {
  width: 34%;
  min-width: 320px;
}

body[data-page="solicitacoes"] #itemsBody .pur-col-qtd,
body[data-page="cotacoes"] #itemsBody .pur-col-qtd,
body[data-page="pedidos"] #itemsBody .pur-col-qtd,
body[data-page="solicitacoes"] th.pur-col-qtd,
body[data-page="cotacoes"] th.pur-col-qtd,
body[data-page="pedidos"] th.pur-col-qtd {
  width: 110px;
  min-width: 110px;
}

body[data-page="solicitacoes"] #itemsBody .pur-col-unidade,
body[data-page="cotacoes"] #itemsBody .pur-col-unidade,
body[data-page="pedidos"] #itemsBody .pur-col-unidade,
body[data-page="solicitacoes"] th.pur-col-unidade,
body[data-page="cotacoes"] th.pur-col-unidade,
body[data-page="pedidos"] th.pur-col-unidade {
  width: 130px;
  min-width: 130px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-money,
body[data-page="pedidos"] #itemsBody .pur-col-money,
body[data-page="cotacoes"] th.pur-col-money,
body[data-page="pedidos"] th.pur-col-money {
  width: 170px;
  min-width: 170px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-total,
body[data-page="pedidos"] #itemsBody .pur-col-total,
body[data-page="cotacoes"] th.pur-col-total,
body[data-page="pedidos"] th.pur-col-total {
  width: 170px;
  min-width: 170px;
  text-align: right;
}

body[data-page="solicitacoes"] #itemsBody .pur-col-acoes,
body[data-page="cotacoes"] #itemsBody .pur-col-acoes,
body[data-page="pedidos"] #itemsBody .pur-col-acoes,
body[data-page="solicitacoes"] th.pur-col-acoes,
body[data-page="cotacoes"] th.pur-col-acoes,
body[data-page="pedidos"] th.pur-col-acoes {
  width: 120px;
  min-width: 120px;
}

body[data-page="solicitacoes"] #itemsBody input,
body[data-page="solicitacoes"] #itemsBody select,
body[data-page="cotacoes"] #itemsBody input,
body[data-page="cotacoes"] #itemsBody select,
body[data-page="pedidos"] #itemsBody input,
body[data-page="pedidos"] #itemsBody select {
  width: 100%;
  max-width: none;
}

.purchase-request-quote-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.purchase-request-quote-card,
.purchase-approval-request-card {
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.purchase-request-quote-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft, #e5e7eb);
  background: #f8fafc;
}

.purchase-request-quote-head h4 {
  margin: 4px 0 4px;
  font-size: 17px;
  color: var(--text-color, #0f172a);
}

.purchase-request-quote-head p {
  margin: 0;
  color: var(--text-soft, #64748b);
  font-size: 13px;
}

.purchase-request-code {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  font-size: 12px;
}

.purchase-nested-table {
  margin: 0;
}

.purchase-nested-table .data-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.purchase-approval-request-row > td {
  padding: 12px 0 !important;
  background: transparent;
}

@media (max-width: 900px) {
  .purchase-request-quote-head {
    flex-direction: column;
  }
}

/* Compras — cotações agrupadas por solicitação */
.purchase-request-quote-head > div:first-child {
  position: relative;
  min-width: 260px;
}

.purchase-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text-color, #0f172a);
  font-weight: 800;
  cursor: pointer;
  vertical-align: middle;
}

.purchase-collapse-btn:hover {
  background: #f1f5f9;
}

.purchase-request-quote-card.is-collapsed .purchase-request-quote-head {
  border-bottom: 0;
}

.purchase-request-quote-body[hidden] {
  display: none !important;
}

.purchase-request-quote-head .primary-btn.table-action-btn {
  color: #fff;
  border-color: transparent;
}

.purchase-request-quote-head .table-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================================================
   Compras - refinamentos de fluxo, abas e comparativos
========================================================= */
body[data-page="cotacoes"] #listArea .filters-row {
  margin-bottom: 16px;
}

.purchase-flow-header-modern {
  align-items: center;
}

.purchase-comparison-inline-panel {
  margin-bottom: 18px;
  scroll-margin-top: 90px;
}

.purchase-comparison-modern {
  display: grid;
  gap: 14px;
}

.purchase-comparison-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef6ff 100%);
}

.purchase-comparison-hero h3 {
  margin: 4px 0;
  font-size: 20px;
  color: var(--text-color, #0f172a);
}

.purchase-comparison-hero p {
  margin: 0;
  color: var(--text-soft, #64748b);
  font-size: 13px;
}

.purchase-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.purchase-best-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  background: #ecfdf3;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.purchase-best-pill strong {
  font-size: 16px;
}

.purchase-comparison-modern .purchase-comparison-summary {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.purchase-comparison-modern .purchase-comparison-summary > div {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.purchase-comparison-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.purchase-comparison-table {
  min-width: 980px;
}

.purchase-quote-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  align-items: start;
}

.purchase-quote-detail-card {
  min-width: 0;
  overflow: hidden;
}

.purchase-quote-detail-card .table-responsive {
  overflow-x: auto;
}

.purchase-quote-detail-card .data-table {
  min-width: 520px;
}

.purchase-quote-detail-card td:first-child,
.purchase-quote-detail-card th:first-child {
  max-width: 240px;
  white-space: normal;
}

.purchase-form-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 18px;
  background: #f8fafc;
}

.purchase-form-topbar h2 {
  margin: 0;
  font-size: 21px;
}

.purchase-form-topbar p {
  margin: 4px 0 0;
  color: var(--text-soft, #64748b);
  font-size: 13px;
}

.purchase-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft, #e5e7eb);
}

.purchase-tab {
  border: 0;
  background: transparent;
  padding: 11px 14px;
  border-radius: 12px 12px 0 0;
  color: var(--text-soft, #64748b);
  font-weight: 700;
  cursor: pointer;
}

.purchase-tab.active {
  background: #fff;
  color: var(--primary-color, #1d4ed8);
  box-shadow: inset 0 -2px 0 var(--primary-color, #1d4ed8);
}

.purchase-tab-panel {
  display: none;
}

.purchase-tab-panel.active {
  display: block;
}

body[data-page="cotacoes"] #itemsBody .pur-col-item,
body[data-page="cotacoes"] th.pur-col-item {
  width: 18%;
  min-width: 190px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-desc,
body[data-page="cotacoes"] th.pur-col-desc {
  width: 36%;
  min-width: 360px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-qtd,
body[data-page="cotacoes"] th.pur-col-qtd {
  width: 95px;
  min-width: 95px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-unidade,
body[data-page="cotacoes"] th.pur-col-unidade {
  width: 120px;
  min-width: 120px;
}

body[data-page="cotacoes"] #itemsBody .pur-col-money,
body[data-page="cotacoes"] th.pur-col-money,
body[data-page="cotacoes"] #itemsBody .pur-col-total,
body[data-page="cotacoes"] th.pur-col-total {
  width: 155px;
  min-width: 155px;
}

body[data-page="compras-aprovacoes"] .compras-approval-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px));
  justify-content: flex-start;
  gap: 14px;
}

body[data-page="compras-aprovacoes"] .compras-approval-metrics .metric-card {
  min-height: 96px;
  padding: 16px 18px;
}

body[data-page="compras-aprovacoes"] .purchase-approval-comparison {
  overflow: hidden;
}

body[data-page="compras-aprovacoes"] .purchase-approval-comparison .purchase-comparison-summary {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

body[data-page="compras-aprovacoes"] .purchase-approval-comparison .purchase-quote-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

body[data-page="compras"] .compras-panel-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr)) minmax(230px, 1.7fr);
  gap: 12px;
  align-items: stretch;
}

body[data-page="compras"] .compras-panel-metrics .metric-card {
  min-height: 98px;
  padding: 16px;
}

body[data-page="compras"] .compras-panel-metrics .metric-card strong {
  font-size: 25px;
}

body[data-page="compras"] .compras-panel-metrics .metric-card-wide strong {
  font-size: 24px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  body[data-page="compras"] .compras-panel-metrics {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
  body[data-page="compras"] .compras-panel-metrics .metric-card-wide {
    grid-column: span 3;
  }
}

@media (max-width: 760px) {
  .purchase-form-topbar,
  .purchase-comparison-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .purchase-comparison-modern .purchase-comparison-summary,
  body[data-page="compras-aprovacoes"] .purchase-approval-comparison .purchase-comparison-summary {
    grid-template-columns: 1fr;
  }
  body[data-page="compras"] .compras-panel-metrics,
  body[data-page="compras-aprovacoes"] .compras-approval-metrics {
    grid-template-columns: 1fr;
  }
  body[data-page="compras"] .compras-panel-metrics .metric-card-wide {
    grid-column: auto;
  }
}


/* =========================================================
   DEMONSTRAÇÃO PÚBLICA
   ========================================================= */
.login-page { background: #071426; padding: 32px; }
.login-shell { width: min(1120px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; min-height: 650px; border-radius: 30px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.30); background: #fff; }
.login-showcase { padding: 64px 58px; color: #fff; background: radial-gradient(circle at 85% 15%, rgba(27,190,207,.28), transparent 35%), linear-gradient(145deg,#071426,#0d2743); display:flex; flex-direction:column; justify-content:center; }
.demo-back-link { color: rgba(255,255,255,.72); text-decoration:none; font-size:13px; position:absolute; top:58px; }
.demo-eyebrow { color:#49d5df; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; margin-bottom:18px; }
.login-showcase h1 { font-size:46px; line-height:1.03; letter-spacing:-.04em; margin:0 0 20px; max-width:520px; }
.login-showcase p { color:rgba(255,255,255,.72); font-size:17px; line-height:1.65; max-width:520px; }
.demo-points { display:grid; gap:12px; margin-top:32px; font-size:14px; color:rgba(255,255,255,.86); }
.login-shell .login-card { max-width:none; border:0; border-radius:0; box-shadow:none; padding:64px 58px; display:flex; flex-direction:column; justify-content:center; }
.login-shell .login-logo { justify-content:flex-start; margin-bottom:22px; }
.login-shell .login-logo img { width:185px; max-width:185px; }
.login-shell .login-title { text-align:left; margin-bottom:18px; }
.login-shell .login-title h2 { margin:0 0 8px; font-size:27px; color:#0b1930; }
.demo-credentials { display:flex; gap:10px; margin-bottom:18px; }
.demo-credentials span { flex:1; border:1px solid #dbe3ed; background:#f7f9fc; border-radius:12px; padding:11px 13px; color:#64748b; font-size:12px; }
.demo-credentials strong { display:block; margin-top:3px; color:#0b1930; font-size:14px; }
.demo-disclaimer { margin:18px 0 0; color:#7b8798; font-size:11px; line-height:1.5; text-align:center; }
.demo-mode-bar { min-height:42px; padding:9px 24px; background:#071426; color:#fff; display:flex; align-items:center; justify-content:center; gap:12px; position:relative; z-index:1000; font-size:12px; }
.demo-mode-bar strong { color:#49d5df; letter-spacing:.08em; }
.demo-mode-bar span { color:rgba(255,255,255,.72); }
.demo-mode-bar a { color:#fff; margin-left:8px; font-weight:700; }
@media(max-width:820px){ .login-page{padding:0}.login-shell{grid-template-columns:1fr;min-height:100vh;border-radius:0}.login-showcase{padding:42px 30px}.demo-back-link{position:static;margin-bottom:60px}.login-showcase h1{font-size:36px}.login-shell .login-card{padding:42px 30px}.demo-mode-bar{align-items:flex-start;flex-direction:column;gap:3px;padding:9px 14px}.demo-mode-bar a{margin-left:0} }
