/* ========================================
   SLDS Clone - Salesforce Lightning Design
   Reproduz fielmente o Lightning Experience
   ======================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Salesforce Brand Colors */
  --slds-blue: #0176d3;
  --slds-blue-dark: #014486;
  --slds-blue-darker: #032d60;
  --slds-blue-light: #1ab9ff;
  --slds-blue-lighter: #cfe9fe;
  --slds-blue-bg: #eaf5fe;

  /* Neutrals */
  --slds-bg: #f3f3f3;
  --slds-bg-alt: #fafaf9;
  --slds-white: #ffffff;
  --slds-border: #dddbda;
  --slds-border-light: #e5e5e5;
  --slds-text: #181818;
  --slds-text-secondary: #3e3e3c;
  --slds-text-tertiary: #706e6b;
  --slds-text-link: #0176d3;

  /* Status Colors */
  --slds-success: #2e844a;
  --slds-success-bg: #cdefc4;
  --slds-warning: #fe9339;
  --slds-warning-bg: #fef1ee;
  --slds-error: #ba0517;
  --slds-error-bg: #feded8;
  --slds-info: #0176d3;

  /* Path / Stage Colors */
  --slds-path-current: #0176d3;
  --slds-path-completed: #04844b;

  /* Shadow */
  --slds-shadow: 0 2px 2px 0 rgba(0,0,0,0.1);
  --slds-shadow-lg: 0 2px 4px 0 rgba(0,0,0,0.16);

  /* Sizing */
  --header-height: 50px;
  --tab-bar-height: 44px;
}

body {
  font-family: 'Salesforce Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--slds-text);
  background: var(--slds-bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ===== GLOBAL HEADER ===== */
.slds-header {
  height: var(--header-height);
  background: linear-gradient(to bottom, #052e5e 0%, #032d60 100%);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.16);
  gap: 8px;
  overflow: hidden;
}

.app-launcher {
  width: 32px;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  cursor: pointer;
  margin-right: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.app-launcher:hover { background: rgba(255,255,255,0.2); }
.app-launcher span {
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
}

.app-name {
  color: white;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.5px;
  margin-right: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}
.app-name strong { font-weight: 700; }

.slds-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 600px;
  height: 32px;
  background: rgba(255,255,255,0.95);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  margin-right: auto;
}
.slds-search svg { width: 14px; height: 14px; fill: #706e6b; margin-right: 8px; }
.slds-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--slds-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
}
.header-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.header-icon:hover { background: rgba(255,255,255,0.1); }
.header-icon svg { width: 18px; height: 18px; fill: white; }
.header-icon .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #fe5c4c;
  color: white;
  font-size: 9px;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4327c 0%, #fe5c4c 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.5);
}

/* ===== TAB BAR (Console Navigation) ===== */
.slds-tabbar {
  background: white;
  border-bottom: 1px solid var(--slds-border);
  display: flex;
  align-items: center;
  height: var(--tab-bar-height);
  padding: 0 16px;
  position: sticky;
  top: var(--header-height);
  z-index: 99;
  overflow-x: auto;
}

.tab-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}
.tab-app-icon.sales { background: #04844b; }
.tab-app-icon.service { background: #cf4f23; }
.tab-app-icon.marketing { background: #f9a825; }
.tab-app-icon.partner { background: #5867e8; }
.tab-app-icon svg { width: 16px; height: 16px; fill: white; }

.tab-app-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--slds-text);
  margin-right: 24px;
  flex-shrink: 0;
}

.slds-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.slds-tab {
  padding: 0 12px;
  height: var(--tab-bar-height);
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--slds-text-secondary);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  gap: 6px;
}
.slds-tab:hover { background: var(--slds-bg-alt); color: var(--slds-text); }
.slds-tab.active {
  color: var(--slds-blue);
  border-bottom-color: var(--slds-blue);
  font-weight: 600;
}
.slds-tab svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.7; }
.slds-tab .tab-dropdown {
  width: 12px; height: 12px; opacity: 0.5;
}

/* ===== MAIN CONTAINER ===== */
.slds-main {
  padding: 16px;
  min-height: calc(100vh - var(--header-height) - var(--tab-bar-height));
}

/* ===== HIGHLIGHTS PANEL (record header) ===== */
.highlights-panel {
  background: white;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--slds-shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.highlights-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.highlights-icon svg { width: 28px; height: 28px; fill: white; }

.highlights-info { flex: 1; min-width: 0; overflow: hidden; }
.highlights-eyebrow {
  font-size: 11px;
  color: var(--slds-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlights-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--slds-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.highlights-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 900px;
}
.highlights-fields > div { min-width: 0; overflow: hidden; }
.highlight-field-label {
  font-size: 11px;
  color: var(--slds-text-tertiary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-field-value {
  font-size: 13px;
  color: var(--slds-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-field-value a { 
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.highlights-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.slds-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--slds-border);
  background: white;
  color: var(--slds-blue);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.slds-btn:hover { background: var(--slds-bg-alt); border-color: #c9c7c5; }
.slds-btn-brand {
  background: var(--slds-blue);
  border-color: var(--slds-blue);
  color: white;
}
.slds-btn-brand:hover { background: #014486; border-color: #014486; }
.slds-btn-icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.slds-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ===== PATH COMPONENT (Opportunity stages) ===== */
.slds-path {
  background: white;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--slds-shadow);
}
.path-stages {
  display: flex;
  position: relative;
  margin-bottom: 12px;
}
.path-stage {
  flex: 1;
  height: 32px;
  background: #ecebea;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--slds-text-secondary);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
  margin-right: -10px;
  transition: all 0.2s;
  cursor: pointer;
}
.path-stage:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}
.path-stage:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
  margin-right: 0;
}
.path-stage.completed {
  background: var(--slds-path-completed);
  color: white;
}
.path-stage.current {
  background: var(--slds-path-current);
  color: white;
  font-weight: 700;
}
.path-stage.completed::after {
  content: "✓";
  margin-right: 6px;
}

/* ===== CARDS ===== */
.slds-card {
  background: white;
  border-radius: 4px;
  box-shadow: var(--slds-shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.slds-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.slds-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slds-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.slds-card-title svg { width: 18px; height: 18px; fill: var(--slds-blue); }
.slds-card-title .count {
  font-weight: 400;
  color: var(--slds-text-tertiary);
  font-size: 13px;
}
.slds-card-body { padding: 12px 16px; }
.slds-card-body.no-padding { padding: 0; }

/* ===== TABS (sub-tabs in record) ===== */
.record-tabs {
  background: white;
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid var(--slds-border);
  padding: 0 16px;
  display: flex;
  gap: 0;
  box-shadow: var(--slds-shadow);
}
.record-tab {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--slds-text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 400;
  transition: all 0.15s;
  text-decoration: none;
}
.record-tab:hover { color: var(--slds-text); }
.record-tab.active {
  color: var(--slds-blue);
  border-bottom-color: var(--slds-blue);
  font-weight: 600;
}

/* ===== TWO COLUMN LAYOUT ===== */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== DETAIL FIELDS ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.detail-field {
  padding: 8px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  min-width: 0;
  overflow: hidden;
}
.detail-field:nth-last-child(-n+2) { border-bottom: none; }
.detail-field-label {
  font-size: 11px;
  color: var(--slds-text-tertiary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.detail-field-label svg { width: 10px; height: 10px; opacity: 0.5; }
.detail-field-value {
  font-size: 13px;
  color: var(--slds-text);
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.detail-field-value a { color: var(--slds-blue); text-decoration: none; word-break: break-all; }
.detail-field-value a:hover { text-decoration: underline; }

/* ===== TABLES ===== */
.slds-card-body.no-padding > table { display: block; overflow-x: auto; max-width: 100%; }
.slds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.slds-table thead th {
  background: var(--slds-bg-alt);
  text-align: left;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--slds-text-secondary);
  border-bottom: 1px solid var(--slds-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.slds-table tbody tr { border-bottom: 1px solid var(--slds-border-light); transition: background 0.15s; }
.slds-table tbody tr:hover { background: var(--slds-blue-bg); }
.slds-table td {
  padding: 10px 12px;
  color: var(--slds-text);
  vertical-align: middle;
}
.slds-table td a { color: var(--slds-blue); text-decoration: none; }
.slds-table td a:hover { text-decoration: underline; }

/* ===== BADGES / PILLS ===== */
.slds-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  background: var(--slds-bg);
  color: var(--slds-text);
}
.slds-badge-success { background: var(--slds-success-bg); color: var(--slds-success); }
.slds-badge-warning { background: var(--slds-warning-bg); color: #8a4a00; }
.slds-badge-error { background: var(--slds-error-bg); color: var(--slds-error); }
.slds-badge-info { background: var(--slds-blue-bg); color: var(--slds-blue-dark); }
.slds-badge-purple { background: #efeafa; color: #5867e8; }

/* ===== AVATARS ===== */
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16325c 0%, #1589ee 100%);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  flex-shrink: 0;
}
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.green { background: linear-gradient(135deg, #04844b 0%, #2e844a 100%); }
.avatar.orange { background: linear-gradient(135deg, #cf4f23 0%, #fe9339 100%); }
.avatar.purple { background: linear-gradient(135deg, #5867e8 0%, #9b59b6 100%); }
.avatar.red { background: linear-gradient(135deg, #ba0517 0%, #fe5c4c 100%); }

/* ===== ICONS (object icons) ===== */
.obj-icon {
  width: 28px; height: 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.obj-icon svg { width: 16px; height: 16px; fill: white; }
.obj-icon.lead { background: #f88962; }
.obj-icon.opp { background: #fcb95b; }
.obj-icon.account { background: #7f8de1; }
.obj-icon.contact { background: #a094ed; }
.obj-icon.case { background: #f2cf5b; }
.obj-icon.campaign { background: #f49256; }
.obj-icon.task { background: #4bc076; }
.obj-icon.event { background: #95aec5; }

/* ===== ACTIVITY TIMELINE ===== */
.activity-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  display: flex;
  gap: 12px;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 14px; height: 14px; fill: white; }
.activity-content { flex: 1; min-width: 0; }
.activity-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--slds-text);
  margin-bottom: 4px;
}
.activity-meta {
  font-size: 12px;
  color: var(--slds-text-tertiary);
}

/* ===== CHATTER FEED ===== */
.chatter-post {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  display: flex;
  gap: 10px;
}
.chatter-post:last-child { border-bottom: none; }
.chatter-content { flex: 1; }
.chatter-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.chatter-name { font-weight: 700; font-size: 13px; color: var(--slds-text); }
.chatter-time { font-size: 11px; color: var(--slds-text-tertiary); }
.chatter-body { font-size: 13px; color: var(--slds-text); line-height: 1.5; }

/* ===== KANBAN ===== */
.kanban {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 600px;
}
.kanban-column {
  min-width: 260px;
  flex: 1;
  background: var(--slds-bg-alt);
  border-radius: 4px;
  border-top: 3px solid var(--slds-blue);
  display: flex;
  flex-direction: column;
}
.kanban-column.won { border-top-color: var(--slds-success); }
.kanban-column.lost { border-top-color: var(--slds-error); }
.kanban-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slds-border-light);
  background: white;
  border-radius: 4px 4px 0 0;
}
.kanban-stage-name { font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--slds-text-secondary); letter-spacing: 0.3px; }
.kanban-stage-meta { font-size: 11px; color: var(--slds-text-tertiary); margin-top: 2px; }
.kanban-cards {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-card {
  background: white;
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: var(--slds-shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 3px solid transparent;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--slds-shadow-lg); }
.kanban-card.feira-fesqua { border-left-color: #c52026; }
.kanban-card.feira-ebrats { border-left-color: #4caf50; }
.kanban-card.feira-infrafm { border-left-color: #2196f3; }
.kanban-card.feira-smartcity { border-left-color: #9c27b0; }
.kanban-card.feira-evtol { border-left-color: #00bcd4; }
.kanban-card.feira-droneshow { border-left-color: #ff5722; }
.kanban-card.feira-mundogeo { border-left-color: #795548; }
.kanban-card.feira-spacebr { border-left-color: #3f51b5; }

.kanban-card-name { font-size: 13px; font-weight: 600; color: var(--slds-blue); margin-bottom: 4px; }
.kanban-card-account { font-size: 12px; color: var(--slds-text-secondary); margin-bottom: 6px; }
.kanban-card-amount { font-size: 14px; font-weight: 700; color: var(--slds-text); }
.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--slds-text-tertiary);
}

/* ===== METRICS / DASHBOARD ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric-card {
  background: white;
  border-radius: 4px;
  padding: 16px;
  box-shadow: var(--slds-shadow);
  border-top: 3px solid var(--slds-blue);
}
.metric-card.green { border-top-color: var(--slds-success); }
.metric-card.orange { border-top-color: var(--slds-warning); }
.metric-card.red { border-top-color: var(--slds-error); }
.metric-card.purple { border-top-color: #5867e8; }
.metric-label {
  font-size: 11px;
  color: var(--slds-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 26px;
  font-weight: 300;
  color: var(--slds-text);
  line-height: 1.1;
  margin-bottom: 4px;
}
.metric-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-trend.up { color: var(--slds-success); }
.metric-trend.down { color: var(--slds-error); }

/* ===== UTILITY BAR (bottom) ===== */
.utility-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #032d60;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 4px;
  z-index: 90;
}
.utility-item {
  height: 24px;
  padding: 0 10px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 11px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.utility-item:hover { background: rgba(255,255,255,0.2); }
.utility-item svg { width: 12px; height: 12px; fill: white; }

/* ===== APP LAUNCHER OVERLAY ===== */
.app-launcher-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 60px;
  padding-left: 16px;
}
.app-launcher-modal.open { display: flex; }
.app-launcher-panel {
  background: white;
  border-radius: 4px;
  width: 480px;
  max-height: 80vh;
  box-shadow: 0 8px 16px rgba(0,0,0,0.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-launcher-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-launcher-search svg { width: 14px; height: 14px; fill: var(--slds-text-tertiary); }
.app-launcher-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
}
.app-launcher-section { padding: 12px 16px; }
.app-launcher-section-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--slds-text-tertiary);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}
.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.app-launcher-item {
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--slds-text);
  transition: background 0.15s;
}
.app-launcher-item:hover { background: var(--slds-bg-alt); }
.app-launcher-item-icon {
  width: 32px; height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-launcher-item-icon svg { width: 18px; height: 18px; fill: white; }
.app-launcher-item-name { font-size: 13px; font-weight: 600; }
.app-launcher-item-desc { font-size: 11px; color: var(--slds-text-tertiary); }

/* ===== MODAL / TOAST ===== */
.toast {
  position: fixed;
  top: 60px;
  right: 16px;
  background: var(--slds-success);
  color: white;
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: var(--slds-shadow-lg);
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 200;
  animation: slideIn 0.3s;
}
.toast.show { display: flex; }
.toast.info { background: var(--slds-blue); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--slds-text-tertiary);
}
.breadcrumb a { color: var(--slds-blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== HELPERS ===== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-8 { gap: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.text-link { color: var(--slds-blue); text-decoration: none; cursor: pointer; }
.text-link:hover { text-decoration: underline; }
.text-muted { color: var(--slds-text-tertiary); }
.text-bold { font-weight: 700; }
.text-success { color: var(--slds-success); font-weight: 600; }
.text-warning { color: #8a4a00; font-weight: 600; }
.text-error { color: var(--slds-error); font-weight: 600; }
.text-right { text-align: right; }

/* ===== JOURNEY BUILDER (Marketing Cloud) ===== */
.journey-canvas {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 32px;
  min-height: 600px;
  position: relative;
  overflow: auto;
  background-image:
    radial-gradient(circle, #d4d4d4 1px, transparent 1px);
  background-size: 16px 16px;
}
.journey-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.journey-node {
  background: white;
  border: 2px solid var(--slds-border);
  border-radius: 6px;
  padding: 12px;
  width: 180px;
  box-shadow: var(--slds-shadow);
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}
.journey-node.entry { border-color: #5867e8; background: #efeafa; }
.journey-node.email { border-color: #f9a825; background: #fff8e1; }
.journey-node.wait { border-color: #909399; background: #f5f5f5; }
.journey-node.decision { border-color: #5867e8; background: white; }
.journey-node.action { border-color: #04844b; background: #e8f5e9; }
.journey-node.exit { border-color: var(--slds-error); background: var(--slds-error-bg); }

.journey-node-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--slds-text-secondary);
}
.journey-node-icon {
  width: 20px; height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.journey-node-icon svg { width: 12px; height: 12px; fill: white; }
.journey-node-title { font-size: 13px; font-weight: 600; color: var(--slds-text); }
.journey-node-meta { font-size: 11px; color: var(--slds-text-tertiary); margin-top: 4px; }

.journey-arrow {
  width: 32px;
  height: 2px;
  background: var(--slds-text-tertiary);
  position: relative;
  flex-shrink: 0;
}
.journey-arrow::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -4px;
  width: 0; height: 0;
  border-left: 6px solid var(--slds-text-tertiary);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.journey-stats {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--slds-border-light);
  font-size: 11px;
}
.journey-stat-num { font-weight: 700; color: var(--slds-blue); }

/* ===== CHART (CSS bar charts) ===== */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 16px 0;
  border-bottom: 1px solid var(--slds-border);
}
.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bar-chart-bar {
  width: 100%;
  max-width: 50px;
  background: linear-gradient(to top, var(--slds-blue) 0%, #1ab9ff 100%);
  border-radius: 2px 2px 0 0;
  position: relative;
  min-height: 4px;
  transition: all 0.3s;
}
.bar-chart-bar:hover { opacity: 0.8; }
.bar-chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--slds-text-secondary);
  font-weight: 600;
  white-space: nowrap;
}
.bar-chart-label {
  font-size: 11px;
  color: var(--slds-text-tertiary);
  text-align: center;
  margin-top: 4px;
}

.donut-chart {
  width: 160px;
  height: 160px;
  margin: 0 auto;
}

/* ===== SERVICE CONSOLE ===== */
.console-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 0;
  height: calc(100vh - var(--header-height) - var(--tab-bar-height));
  background: white;
}
.console-list {
  background: white;
  border-right: 1px solid var(--slds-border);
  overflow-y: auto;
}
.console-list-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  background: var(--slds-bg-alt);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.console-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slds-border-light);
  cursor: pointer;
  transition: background 0.15s;
}
.console-list-item:hover { background: var(--slds-bg-alt); }
.console-list-item.active { background: var(--slds-blue-bg); border-left: 3px solid var(--slds-blue); padding-left: 13px; }
.case-num { font-size: 12px; color: var(--slds-blue); font-weight: 600; }
.case-subject { font-size: 13px; color: var(--slds-text); margin: 2px 0; font-weight: 500; }
.case-meta { font-size: 11px; color: var(--slds-text-tertiary); display: flex; align-items: center; gap: 8px; }

.console-detail { background: var(--slds-bg); overflow-y: auto; padding: 12px; }
.console-related { background: white; border-left: 1px solid var(--slds-border); overflow-y: auto; }

/* ===== EINSTEIN BOT ===== */
.einstein-chat {
  background: white;
  border-radius: 4px;
  box-shadow: var(--slds-shadow);
  display: flex;
  flex-direction: column;
  height: 500px;
}
.einstein-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #032d60 0%, #1589ee 100%);
  color: white;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.einstein-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.einstein-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafaf9;
}
.bot-msg, .user-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.bot-msg {
  background: white;
  align-self: flex-start;
  border: 1px solid var(--slds-border-light);
  border-bottom-left-radius: 2px;
}
.user-msg {
  background: var(--slds-blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.einstein-input {
  padding: 12px;
  border-top: 1px solid var(--slds-border-light);
  display: flex;
  gap: 8px;
}
.einstein-input input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--slds-border);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.einstein-input input:focus { border-color: var(--slds-blue); box-shadow: 0 0 0 1px var(--slds-blue); }

/* ===== APP SWITCHER LANDING ===== */
.app-switcher-page {
  min-height: calc(100vh - var(--header-height));
  background: linear-gradient(135deg, #032d60 0%, #014486 50%, #0176d3 100%);
  padding: 60px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.app-switcher-title {
  color: white;
  font-size: 32px;
  font-weight: 300;
  margin-bottom: 8px;
  text-align: center;
}
.app-switcher-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  margin-bottom: 48px;
  text-align: center;
  max-width: 600px;
}
.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
}
.app-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  color: var(--slds-text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 4px solid var(--slds-blue);
  cursor: pointer;
}
.app-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.24); }
.app-card.sales { border-top-color: #04844b; }
.app-card.service { border-top-color: #cf4f23; }
.app-card.marketing { border-top-color: #f9a825; }
.app-card.partner { border-top-color: #5867e8; }
.app-card.analytics { border-top-color: #16325c; }
.app-card.setup { border-top-color: #706e6b; }
.app-card-icon {
  width: 48px; height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-card-icon svg { width: 28px; height: 28px; fill: white; }
.app-card-name { font-size: 18px; font-weight: 700; }
.app-card-desc { font-size: 13px; color: var(--slds-text-secondary); flex: 1; }
.app-card-meta { font-size: 11px; color: var(--slds-text-tertiary); display: flex; align-items: center; gap: 4px; }

/* ===== MARKETING CLOUD SPECIFIC ===== */
.mc-tabs {
  background: white;
  border-bottom: 1px solid var(--slds-border);
  padding: 0 16px;
  display: flex;
}
.mc-tab {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--slds-text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font-weight: 500;
}
.mc-tab.active { color: #f9a825; border-bottom-color: #f9a825; font-weight: 700; }
.mc-tab:hover { color: var(--slds-text); }

/* ===== EMAIL PREVIEW ===== */
.email-preview {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.email-header-bar {
  background: var(--slds-bg-alt);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--slds-text-tertiary);
  border-bottom: 1px solid var(--slds-border-light);
}
.email-meta-row { display: flex; padding: 4px 0; }
.email-meta-label { width: 60px; font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .slds-search { display: none; }
  .app-name { font-size: 14px; }
  .console-layout { grid-template-columns: 1fr; }
  .console-list, .console-related { display: none; }
}
