/* Campaign workspace layout: clean, professional, compact SaaS density */
.shell, .shell main#main, .shell .panel, .shell .content-card { min-width: 0; box-sizing: border-box; }
.shell { min-height: 100vh; background: #f8fafc; }
.shell main#main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 20px 28px; box-sizing: border-box; }

/* Refined Topbar */
.shell .topbar {
  height: 56px;
  min-height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  box-sizing: border-box;
}
.shell .menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
}
.shell .breadcrumb {
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
}
.shell .breadcrumb span {
  margin: 0 8px;
  color: #cbd5e1;
}

.shell .account {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  margin-left: auto;
}
.shell .today {
  color: #94a3b8;
  font-size: 12px;
  padding-right: 14px;
  border-right: 1px solid #e2e8f0;
}
.shell .user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1e293b;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  transition: background .12s ease;
}
.shell .user-chip:hover {
  background: #e2e8f0;
  text-decoration: none;
}
.shell .user-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #047857;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.shell .account-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell .link-button {
  background: none;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.shell .link-button:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  text-decoration: none;
}
.shell .platform-return {
  color: #047857;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ecfdf5;
}

/* Page Headings and Action Bars */
.shell .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 16px;
}
.shell .page-heading h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}
.shell .page-heading p {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.4;
}
.shell .page-heading .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #047857;
  margin-bottom: 2px;
}

/* Panels and Cards */
.shell .panel, .shell .content-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  margin-bottom: 16px;
}
.shell .panel.padded, .shell .content-card.padded {
  padding: 16px 20px;
}
.shell .panel-heading, .shell .content-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.shell .panel-heading h2, .shell .content-card-header h2 {
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact Metrics & Grids */
.shell .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.shell .metric {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease;
}
.shell .metric:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  text-decoration: none;
}
.shell .metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.shell .metric strong {
  display: block;
  font-size: 1.65rem;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 4px 0 2px;
}
.shell .metric small {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
}

/* Forms and Inputs */
.shell .form-panel {
  max-width: 1100px;
  padding: 20px 24px;
}
.shell .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.shell input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .shell select, .shell textarea {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13.5px;
  box-sizing: border-box;
}
.shell input:focus, .shell select:focus, .shell textarea:focus {
  border-color: #10b981;
  outline: 2px solid rgba(16, 185, 129, 0.2);
  outline-offset: 0;
}
.shell label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 3px;
}
.shell .button {
  min-height: 38px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}
.shell .form-footer, .shell .button-group {
  gap: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

/* Unified Filters Bar */
.shell .filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.shell .filters .search {
  flex: 1 1 260px;
  max-width: 480px;
  margin: 0;
}
.shell .filters input, .shell .filters select {
  height: 36px;
  min-height: 36px;
  margin: 0;
  font-size: 13px;
}
.shell .filters .muted {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* Tables and Records */
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.shell .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  text-align: left;
}
.shell .table-wrap th {
  padding: 9px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shell .table-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #1e293b;
  vertical-align: middle;
}
.shell .table-wrap tbody tr:hover {
  background: #f8fafc;
}
.shell .table-title {
  font-weight: 600;
  color: #0f172a;
}
.shell .table-title:hover {
  color: #047857;
  text-decoration: underline;
}

/* Detail Key-Value Grid */
.shell .detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.shell .record-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 12px 0 0;
}
.shell .record-fields > div {
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.shell .record-fields dt {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 3px;
}
.shell .record-fields dd {
  margin: 0;
  font-size: 13.5px;
  color: #0f172a;
}

/* Compact Checkboxes & Radio */
.shell .checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shell .checkbox-field > input {
  margin: 0;
  accent-color: #047857;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.badge.teal, .badge.status-concluido { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge.priority-high, .badge.status-em_andamento { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge.priority-critical { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .shell main#main { padding: 16px 18px; }
  .shell .menu-toggle { display: inline-flex; }
  .shell .breadcrumb, .shell .today { display: none; }
  .shell .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .shell main#main { padding: 12px 14px; }
  .shell .topbar { padding: 0 14px; height: 50px; min-height: 50px; }
  .shell .form-grid, .shell .record-fields { grid-template-columns: minmax(0, 1fr); }
  .shell .page-heading h1 { font-size: 1.25rem; }
  .shell .button-group { width: 100%; }
}
