/* ProSky CRM — Base CSS & Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* Brand Tokens - Identidade Visual v2 */
  --brand-aqua: #22F2E3;
  --brand-cyan: #08E1FA;
  --brand-sky: #049DFC;
  --brand-blue: #004FFA;
  --brand-blue-deep: #003EFB;
  --brand-highlight: #CBFAFD;
  --navy-950: #030E29;
  --navy-900: #051233;
  --navy-800: #0B1F4D;
  --navy-700: #12306B;

  /* Semantic Theme Tokens — Claro */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  --text: #0F172A;
  --text-muted: #475569;
  --text-subtle: #475569;
  --link: #004FFA;
  --link-hover: #003EFB;
  --focus: #004FFA;
  --focus-ring: rgba(0, 79, 250, 0.25);

  /* Status Semânticos (WCAG AA ≥ 4.5:1) */
  --status-success-text: #065f46;
  --status-success-bg: rgba(13, 148, 136, 0.12);
  --status-success-border: rgba(13, 148, 136, 0.28);
  --status-warning-text: #92400e;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-warning-border: rgba(245, 158, 11, 0.28);
  --status-danger-text: #b91c1c;
  --status-danger-bg: rgba(239, 68, 68, 0.14);
  --status-danger-border: rgba(239, 68, 68, 0.28);
  --status-info-text: #1d4ed8;
  --status-info-bg: rgba(37, 99, 235, 0.12);
  --status-info-border: rgba(37, 99, 235, 0.28);

  /* Sidebar Tokens */
  --sidebar-bg: var(--navy-900);
  --sidebar-border: var(--navy-800);
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --sidebar-user-role: #CBD5E1;

  /* Aliases / Semantic mapping */
  --sky-950: var(--navy-950);
  --sky-900: var(--navy-900);
  --sky-800: var(--navy-800);
  --sky-700: var(--brand-blue-deep);
  --sky-600: var(--brand-blue);
  --sky-500: var(--brand-sky);
  --sky-400: var(--brand-cyan);
  --teal-500: #0D9488;
  --amber-500: #D97706;
  --red-500: #DC2626;
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --white: #FFFFFF;

  /* Safe Area Insets */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  /* Gradients */
  --brand-gradient: linear-gradient(135deg, #22F2E3 0%, #049DFC 45%, #004FFA 100%);
  --brand-gradient-dark: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  --gradient-action: linear-gradient(135deg, #0B62FF 0%, #004FFA 60%, #003EFB 100%);

  /* UI Variables */
  --font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 88px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* Semantic Theme Tokens — Escuro */
  --bg: #070E22;
  --surface: #0E1A3A;
  --surface-2: #132348;
  --border: #1F2F5C;
  --border-subtle: #17264C;
  --text: #E8EEFB;
  --text-muted: #A9B6D6;
  --text-subtle: #8BA0C8;
  --link: #5B9BFF;
  --link-hover: #7CB1FF;
  --focus: var(--brand-aqua);
  --focus-ring: rgba(34, 242, 227, 0.35);

  /* Status Semânticos (WCAG AA ≥ 4.5:1) */
  --status-success-text: #34D399;
  --status-success-bg: rgba(52, 211, 153, 0.16);
  --status-success-border: rgba(52, 211, 153, 0.35);
  --status-warning-text: #FBBF24;
  --status-warning-bg: rgba(251, 191, 36, 0.16);
  --status-warning-border: rgba(251, 191, 36, 0.35);
  --status-danger-text: #F87171;
  --status-danger-bg: rgba(248, 113, 113, 0.16);
  --status-danger-border: rgba(248, 113, 113, 0.35);
  --status-info-text: #60A5FA;
  --status-info-bg: rgba(96, 165, 250, 0.16);
  --status-info-border: rgba(96, 165, 250, 0.35);

  /* Sidebar Tokens in Dark Theme */
  --sidebar-bg: #030818;
  --sidebar-border: #1F2F5C;
  --sidebar-text: #A9B6D6;
  --sidebar-text-active: #FFFFFF;
  --sidebar-user-role: #CBD5E1;

  /* Aliases / Semantic mapping in dark theme */
  --slate-900: var(--text);
  --slate-700: var(--text-muted);
  --slate-600: var(--text-muted);
  --slate-500: var(--text-muted);
  --slate-200: var(--border);
  --slate-100: var(--surface-2);
  --slate-50: var(--bg);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 18px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    /* Semantic Theme Tokens — Escuro */
    --bg: #070E22;
    --surface: #0E1A3A;
    --surface-2: #132348;
    --border: #1F2F5C;
    --border-subtle: #17264C;
    --text: #E8EEFB;
    --text-muted: #A9B6D6;
    --text-subtle: #8BA0C8;
    --link: #5B9BFF;
    --link-hover: #7CB1FF;
    --focus: var(--brand-aqua);
    --focus-ring: rgba(34, 242, 227, 0.35);

    /* Status Semânticos (WCAG AA ≥ 4.5:1) */
    --status-success-text: #34D399;
    --status-success-bg: rgba(52, 211, 153, 0.16);
    --status-success-border: rgba(52, 211, 153, 0.35);
    --status-warning-text: #FBBF24;
    --status-warning-bg: rgba(251, 191, 36, 0.16);
    --status-warning-border: rgba(251, 191, 36, 0.35);
    --status-danger-text: #F87171;
    --status-danger-bg: rgba(248, 113, 113, 0.16);
    --status-danger-border: rgba(248, 113, 113, 0.35);
    --status-info-text: #60A5FA;
    --status-info-bg: rgba(96, 165, 250, 0.16);
    --status-info-border: rgba(96, 165, 250, 0.35);

    /* Sidebar Tokens */
    --sidebar-bg: #030818;
    --sidebar-border: #1F2F5C;
    --sidebar-text: #A9B6D6;
    --sidebar-text-active: #FFFFFF;
    --sidebar-user-role: #CBD5E1;

    /* Aliases / Semantic mapping in dark theme */
    --slate-900: var(--text);
    --slate-700: var(--text-muted);
    --slate-600: var(--text-muted);
    --slate-500: var(--text-muted);
    --slate-200: var(--border);
    --slate-100: var(--surface-2);
    --slate-50: var(--bg);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 18px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--link-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Layout Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Sidebar Styling - Compact Rail on Desktop */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 2px 0 12px rgba(11, 37, 69, 0.15);
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--sidebar-text-active);
  min-height: 44px;
}

.brand-logo-mark {
  display: block;
}

.brand-logo-full {
  display: none;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.sidebar-logo-full {
  height: 40px;
  width: auto;
  max-width: 170px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  font-weight: 500;
  width: 76px;
  min-height: 52px;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  scrollbar-width: none;
}

.nav-item::-webkit-scrollbar {
  display: none;
}

.nav-item:hover {
  color: var(--sidebar-text-active);
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: var(--white);
  background: var(--brand-blue);
  background-image: var(--gradient-action);
  font-weight: 600;
  border-left: none;
  box-shadow: 0 4px 12px rgba(0, 79, 250, 0.35);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label {
  font-size: 12px;
  line-height: 1.15;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align: center;
}

.nav-lock-badge {
  font-size: 0.7rem;
  margin-left: 2px;
  opacity: 0.8;
}

.sidebar-footer {
  padding: 12px 6px;
  border-top: 1px solid var(--sidebar-border);
  background-color: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sidebar-user-details {
  position: relative;
  display: flex;
  justify-content: center;
}

.sidebar-user-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

.sidebar-user-summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--gradient-action);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-user-popover {
  position: fixed;
  left: 82px;
  bottom: 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  min-width: 220px;
  max-width: 280px;
  z-index: 1000;
  text-align: left;
}

.sidebar-user-details:not([open]) .sidebar-user-popover {
  display: none !important;
}

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

.user-popover-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-role {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.user-popover-divider {
  height: 1px;
  background-color: var(--border);
  margin: 10px 0;
}

.user-popover-logout-form {
  margin: 0;
}

.user-popover-logout-btn {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.user-popover-logout-btn:hover {
  background-color: var(--red-500);
  color: var(--white);
  border-color: var(--red-500);
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  transition: var(--transition);
}

.app-header {
  min-height: var(--header-height);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

/* Global Search */
.global-search-container {
  flex: 0 1 520px;
  width: min(520px, 40vw);
  min-width: 220px;
  position: relative;
}

.global-search-wrapper {
  position: relative;
  width: 100%;
}

.global-search-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.global-search-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0 38px 0 38px;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.global-search-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background-color: var(--surface);
}

.search-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-shortcut-hint {
  position: absolute;
  right: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  font-family: inherit;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 95;
  padding: 6px 0;
}

.search-group-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 14px 4px 14px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  min-height: 44px;
}

.search-item:hover,
.search-item.is-selected {
  background-color: var(--surface-2);
}

.search-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-icon-deal {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
}

.search-icon-contact {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-detail {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-value {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.search-message {
  padding: 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn-mobile-search-close {
  display: none;
}

.mobile-search-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

/* Quick Create Menu */
.quick-create-dropdown {
  position: relative;
  display: inline-block;
}

.quick-create-summary {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-blue);
  background-image: var(--gradient-action);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 79, 250, 0.3);
  transition: var(--transition);
}

.quick-create-summary::-webkit-details-marker {
  display: none;
}

.quick-create-summary:hover {
  filter: brightness(1.08);
}

.quick-create-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 95;
  padding: 6px 0;
}

.quick-create-dropdown:not([open]) .quick-create-menu {
  display: none !important;
}

.quick-create-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  transition: background 0.15s;
}

.quick-create-item:hover {
  background-color: var(--surface-2);
  color: var(--link);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle:hover {
  background-color: var(--surface-2);
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Preferences (Theme & Language) Controls */
.pref-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.pref-dropdown {
  position: relative;
  display: inline-block;
}

.pref-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  list-style: none;
  border: 1px solid transparent;
  background: transparent;
  transition: var(--transition);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pref-summary::-webkit-details-marker,
.pref-summary::marker {
  display: none;
}

.pref-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.pref-lang-code {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}

/* App Variant */
.pref-app .pref-summary {
  color: var(--text-muted);
}

.pref-app .pref-summary:hover,
.pref-app .pref-summary:focus-visible,
.pref-app .pref-dropdown[open] > .pref-summary {
  color: var(--text);
  background-color: var(--surface-2);
  border-color: var(--border);
}

/* Navy Variant (Landing, Login, Cadastro, Captura) */
.pref-navy .pref-summary {
  color: rgba(255, 255, 255, 0.75);
}

.pref-navy .pref-summary:hover,
.pref-navy .pref-summary:focus-visible,
.pref-navy .pref-dropdown[open] > .pref-summary {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.pref-summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Dropdown Menu */
.pref-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pref-footer .pref-menu,
.pref-mobile-drawer .pref-menu {
  top: auto;
  bottom: calc(100% + 4px);
}

.pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  box-sizing: border-box;
}

.pref-item:hover,
.pref-item:focus-visible {
  background-color: var(--surface-2);
  color: var(--text);
  outline: none;
}

.pref-item.active {
  color: var(--link);
  font-weight: 600;
}

.pref-item-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pref-item-text {
  line-height: 1.25;
}

.pref-check-wrap {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--link);
}

/* Public Preferences Wrapper */
.public-pref-wrapper {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
}

.app-content {
  padding: 32px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Overlay for Mobile Sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 95;
}

/* Alert Banners */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.925rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

.alert-error {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

.alert-warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning-border);
}

.alert-info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 42px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-action);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  opacity: 0.93;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background-color: var(--red-500);
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #dc2626;
  color: #FFFFFF;
}

.btn-success {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
  font-weight: 600;
}

.btn-success:hover:not(:disabled) {
  background-color: var(--status-success-border);
  color: var(--status-success-text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
  min-height: 36px;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Cards System */
.card {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  max-width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* KPI Dashboard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.sky { background-color: rgba(0, 79, 250, 0.1); color: var(--brand-blue); }
.kpi-icon.teal { background-color: rgba(13, 148, 136, 0.1); color: var(--teal-500); }
.kpi-icon.amber { background-color: rgba(217, 119, 6, 0.1); color: var(--amber-500); }
.kpi-icon.red { background-color: rgba(220, 38, 38, 0.1); color: var(--red-500); }

.kpi-data {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-value {
  font-size: clamp(1.15rem, 0.6rem + 1.2vw, 1.55rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi-label {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Docs Grid for Integrations */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 24px;
}

/* Tables */
.table-container {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent),
    linear-gradient(to right, transparent, var(--surface) 70%) 0 100%,
    radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.15), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.15), transparent) 0 100%;
  background-repeat: no-repeat;
  background-color: var(--surface);
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-attachment: local, local, scroll, scroll;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: var(--surface-2);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background-color: var(--surface-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
}

.badge-baixa { background-color: var(--surface-2); color: var(--text-muted); }
.badge-media { background-color: var(--status-info-bg); color: var(--status-info-text); border: 1px solid var(--status-info-border); }
.badge-alta { background-color: var(--status-warning-bg); color: var(--status-warning-text); border: 1px solid var(--status-warning-border); }
.badge-critica { background-color: var(--status-danger-bg); color: var(--status-danger-text); border: 1px solid var(--status-danger-border); }

.badge-aberto { background-color: var(--status-info-bg); color: var(--status-info-text); border: 1px solid var(--status-info-border); }
.badge-em_andamento { background-color: var(--status-warning-bg); color: var(--status-warning-text); border: 1px solid var(--status-warning-border); }
.badge-resolvido { background-color: var(--status-success-bg); color: var(--status-success-text); border: 1px solid var(--status-success-border); }
.badge-fechado { background-color: var(--surface-2); color: var(--text-muted); }
.badge-canal { background-color: var(--status-info-bg); color: var(--status-info-text); border: 1px solid var(--status-info-border); }
.badge-neutral { background-color: var(--surface-2); color: var(--text-muted); }

/* SLA Badges - BRAND.md */
.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.sla-ok { background-color: var(--status-success-bg); color: var(--status-success-text); }
.sla-atencao { background-color: var(--status-warning-bg); color: var(--status-warning-text); }
.sla-estourado { background-color: var(--status-danger-bg); color: var(--status-danger-text); }

/* ========================================================= */
/* PIPELINE & KANBAN CRM SYSTEM                             */
/* ========================================================= */

.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.badge-alerta {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.badge-etapa {
  background-color: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

/* Pipeline Header Toolbar */
.pipeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

@media (min-width: 1100px) {
  .pipeline-toolbar {
    flex-wrap: nowrap;
  }
}

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

.pipeline-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.kanban-mobile-indicator {
  display: none;
}

.pipeline-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.segmented-btn.active {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented-btn:hover:not(.active) {
  color: var(--text);
}

.segmented-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.pipeline-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Kanban Board Container */
.kanban-view-container {
  width: 100%;
}

.kanban-board {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* 4 Open Fluid Columns */
.kanban-open-columns {
  display: flex;
  flex: 1 1 auto;
  gap: 12px;
  min-width: 0;
}

.kanban-column {
  flex: 1 1 0;
  min-width: 0;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  min-height: 480px;
}

/* Chevron Column Header */
.kanban-chevron-header {
  position: relative;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  clip-path: polygon(0% 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 0% 100%, 10px 50%);
  margin-left: -6px;
  transition: var(--transition);
}

.kanban-open-columns > .kanban-column:first-child .kanban-chevron-header {
  clip-path: polygon(0% 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 0% 100%);
  margin-left: 0;
}

.kanban-chevron-header.has-deals {
  background-color: var(--surface);
  border-top: 2px solid var(--brand-blue);
}

.kanban-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-column-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-count {
  background-color: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  flex-shrink: 0;
}

.kanban-column-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-total-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-add-deal-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.kanban-add-deal-btn:hover {
  color: var(--link);
  border-color: var(--link);
  background-color: var(--surface);
}

.kanban-add-deal-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* Dropzone & Cards List */
.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

.kanban-cards.drag-over {
  background-color: rgba(0, 79, 250, 0.08);
  border: 2px dashed var(--link);
  border-radius: var(--radius-md);
}

.kanban-empty-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 10px;
}

.kanban-empty-dropzone.hidden {
  display: none !important;
}

/* Compact Kanban Card */
.kanban-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: var(--transition);
  user-select: none;
  position: relative;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--link);
}

.kanban-card.dragging {
  opacity: 0.35;
  transform: scale(0.98);
}

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

.kanban-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.kanban-card-menu {
  position: relative;
  flex-shrink: 0;
}

.kanban-card-menu-btn {
  list-style: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: var(--transition);
}

.kanban-card-menu-btn::-webkit-details-marker,
.kanban-card-menu-btn::marker {
  display: none;
}

.kanban-card-menu-btn:hover {
  background-color: var(--surface-2);
  color: var(--text);
}

.kanban-card-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  z-index: 100;
  padding: 4px 0;
}

.kanban-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  width: 100%;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.kanban-menu-item:hover {
  background-color: var(--surface-2);
  color: var(--link);
}

.kanban-menu-item.kanban-menu-danger {
  color: var(--status-danger-text);
}

.kanban-menu-item.kanban-menu-danger:hover {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.kanban-card-contact {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-person-row,
.contact-company-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.contact-person-row svg {
  flex-shrink: 0;
}

.contact-text,
.company-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.contact-company-row .company-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 20px;
}

.kanban-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kanban-card-date.is-overdue {
  color: var(--status-danger-text);
  font-weight: 600;
}

.kanban-card-date svg {
  flex-shrink: 0;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.kanban-card-value {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
}

.kanban-card-owner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Kanban Touch Stage Mover */
.kanban-card-move {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.kanban-move-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

@media (min-width: 1100px) and (hover: hover) {
  .kanban-card-move {
    display: none;
  }
}

/* 2 Closed Strips at Right: Ganho & Perdido */
.kanban-closed-strips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 140px;
  min-width: 140px;
  flex-shrink: 0;
}

.kanban-closed-strip {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

.kanban-strip-ganho {
  border-top: 3px solid var(--status-success-border);
}

.kanban-strip-perdido {
  border-top: 3px solid var(--status-danger-border);
}

.kanban-closed-strip.drag-over {
  background-color: rgba(0, 79, 250, 0.08);
  border: 2px dashed var(--link);
}

.kanban-strip-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  width: 100%;
  min-height: 80px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: center;
  gap: 4px;
}

.kanban-strip-toggle:hover {
  background-color: var(--surface-2);
}

.kanban-strip-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.strip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.strip-badge.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.strip-badge.badge-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.strip-title-text {
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.kanban-strip-body {
  border-top: 1px solid var(--border);
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  background-color: var(--surface-2);
}

.kanban-strip-body.hidden {
  display: none !important;
}

/* ========================================================= */
/* LISTA VIEW & FILTERS                                      */
/* ========================================================= */
.lista-view-container {
  width: 100%;
}

.lista-view-container.hidden {
  display: none !important;
}

.lista-filter-card {
  margin-bottom: 16px;
  padding: 14px 16px;
}

.lista-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-search-wrap {
  flex: 1 1 240px;
  min-width: 200px;
}

.filter-select-wrap {
  flex: 0 1 200px;
  min-width: 150px;
}

.lista-negocios-table th {
  white-space: nowrap;
  user-select: none;
}

.lista-negocios-table th[data-sort] {
  cursor: pointer;
}

.lista-negocios-table th[data-sort]:hover {
  color: var(--link);
}

/* ========================================================= */
/* DETALHE DO NEGÓCIO (public/negocio.php)                   */
/* ========================================================= */
.negocio-detalhe-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.negocio-topbar {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.negocio-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.negocio-topbar-breadcrumb {
  margin-bottom: 4px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
}

.back-link:hover {
  color: var(--link);
}

.negocio-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.negocio-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.negocio-main-title,
.negocio-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
  word-break: break-word;
}

.negocio-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.negocio-more-actions,
.more-actions-dropdown {
  position: relative;
  display: inline-block;
}

.negocio-more-actions:not([open]) .negocio-more-dropdown,
.more-actions-dropdown:not([open]) .more-actions-menu {
  display: none !important;
}

.negocio-more-dropdown,
.more-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 100;
  padding: 4px 0;
}

.more-actions-summary {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.more-actions-summary::-webkit-details-marker,
.more-actions-summary::marker {
  display: none;
}

.more-actions-summary:hover {
  background-color: var(--surface);
  border-color: var(--link);
  color: var(--link);
}

.more-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 100;
  padding: 4px 0;
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.more-menu-item:hover {
  background-color: var(--surface-2);
  color: var(--link);
}

.more-menu-item.menu-item-danger {
  color: var(--status-danger-text);
}

.more-menu-item.menu-item-danger:hover {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.status-closed-banner {
  border-radius: var(--radius-md);
  padding: 10px 16px;
}

.status-closed-banner.banner-won {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}

.status-closed-banner.banner-lost {
  background-color: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger-text);
}

.status-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Stage Chevrons Ribbon */
.stage-chevrons-bar {
  width: 100%;
}

.stage-chevrons-container {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: var(--radius-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  gap: 2px;
}

.stage-chevrons-container::-webkit-scrollbar {
  display: none;
}

.stage-chevron-btn {
  flex: 1 1 0;
  min-width: 140px;
  min-height: 44px;
  scroll-snap-align: start;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 8px 22px;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  background-color: var(--surface);
  color: var(--text-muted);
  clip-path: polygon(0% 0%, calc(100% - 12px) 0%, 100% 50%, calc(100% - 12px) 100%, 0% 100%, 12px 50%);
  margin-left: -8px;
  transition: var(--transition);
}

.stage-chevron-btn:first-child {
  clip-path: polygon(0% 0%, calc(100% - 12px) 0%, 100% 50%, calc(100% - 12px) 100%, 0% 100%);
  margin-left: 0;
  padding-left: 14px;
}

.stage-chevron-btn:last-child {
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 12px 50%);
}

.stage-chevron-btn:only-child {
  clip-path: none;
  margin-left: 0;
  padding-left: 14px;
}

.stage-chevron-btn.is-completed {
  background-color: var(--surface-2);
  color: var(--text);
}

.stage-chevron-btn.is-active {
  background-color: var(--brand-blue);
  color: #FFFFFF;
  font-weight: 700;
}

.stage-chevron-btn.is-upcoming {
  background-color: var(--surface);
  color: var(--text-muted);
}

.stage-chevron-btn:hover:not(.is-active) {
  background-color: var(--surface-2);
  color: var(--link);
}

.stage-chevron-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  z-index: 2;
}

.chevron-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.08);
}

.stage-chevron-btn.is-active .chevron-step-num {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* 3-Zone Layout Grid */
.negocio-layout-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  width: 100%;
}

.negocio-col-left {
  order: 1;
  min-width: 0;
}

.negocio-col-center {
  order: 2;
  min-width: 0;
}

.negocio-col-right {
  order: 3;
  min-width: 0;
}

@media (max-width: 1099.98px) {
  .negocio-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
  }

  .negocio-col-center {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .negocio-col-left {
    order: 2;
    width: 100%;
    min-width: 0;
  }

  .negocio-col-right {
    order: 3;
    width: 100%;
    min-width: 0;
  }
}

/* Zone 1 Summary Card */
.summary-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.summary-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 2px 0;
}

.summary-contact-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.contact-link:hover {
  color: var(--link);
  text-decoration: underline;
}

.summary-contact-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.summary-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  margin-top: 6px;
  color: var(--text-muted);
}

.contact-text-link {
  color: var(--link);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.contact-text-link:hover {
  text-decoration: underline;
}

.summary-owner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.owner-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.owner-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.summary-forecast {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.summary-forecast.is-overdue {
  color: var(--status-danger-text);
  font-weight: 600;
}

.summary-meta-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.meta-label {
  color: var(--text-muted);
}

.meta-value {
  color: var(--text);
  font-weight: 500;
}

/* Zone 2 Center Composer & Timeline */
.composer-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.composer-tabs {
  display: flex;
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 4px 6px 0 6px;
  gap: 2px;
}

.composer-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  min-height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.composer-tab:hover {
  color: var(--text);
}

.composer-tab.active {
  background-color: var(--surface);
  color: var(--link);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
}

.composer-tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

@media (max-width: 600px) {
  .composer-tabs {
    padding: 2px 4px 0 4px;
    gap: 2px;
  }

  .composer-tab {
    padding: 8px 4px;
    font-size: 0.75rem;
    gap: 4px;
    flex: 1 1 0;
    justify-content: center;
  }
}


.composer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer-textarea {
  min-height: 90px;
}

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

.composer-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Timeline */
.timeline-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.timeline-filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-chip {
  padding: 8px 14px;
  min-height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timeline-chip:hover {
  background-color: var(--surface-2);
  color: var(--text);
}

.timeline-chip.active {
  background: var(--brand-blue);
  background-image: var(--gradient-action);
  color: #FFFFFF;
  border-color: var(--brand-blue);
  font-weight: 700;
}

.timeline-chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.timeline-feed {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.timeline-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-icon-nota {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
}

.timeline-icon-ligacao {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.timeline-icon-email {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
}

.timeline-icon-reuniao {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
}

.timeline-icon-mudanca_etapa {
  background-color: var(--surface-2);
  color: var(--text-muted);
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

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

.timeline-user {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.timeline-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Zone 3 Right Column */
.right-contact-card, .related-deals-card {
  padding: 16px;
  margin-bottom: 16px;
}

.right-card-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.right-contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.right-contact-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.right-contact-role {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.contact-scoring-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background-color: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.scoring-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.related-deals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-deal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.related-deal-item:hover {
  border-color: var(--link);
}

.related-deal-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-deal-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ========================================================= */
/* CONTATOS PAGE TOOLBAR & DENSE TABLE                       */
/* ========================================================= */
.contatos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.contatos-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contatos-filter-card {
  margin-bottom: 16px;
  padding: 14px 16px;
}

.contatos-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contatos-dense-table th {
  /* Sem position:sticky de propósito: .table-container precisa de overflow-x:auto pra rolagem
     horizontal da tabela, e isso automaticamente vira o "containing block" do sticky nessa coluna
     também (regra do CSS: overflow-x != visible força overflow-y computado pra auto) — o cabeçalho
     ficava "grudado" 70px abaixo do topo do próprio contêiner mesmo sem rolar a página, sobrepondo
     a primeira linha. Ver commit que corrigiu isso antes de tentar reativar sticky aqui. */
  background-color: var(--surface);
  white-space: nowrap;
  user-select: none;
}

.contatos-dense-table th[data-sort] {
  cursor: pointer;
}

.contatos-dense-table th[data-sort]:hover {
  color: var(--link);
}

.sort-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.contact-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-table-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.table-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--link);
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}


/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background-color: var(--surface-2);
  color: var(--text);
}

.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.modal-footer {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--surface-2);
}

/* Login & Cadastro Page Specifics */
.login-body {
  background: var(--brand-gradient-dark);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  overflow-x: hidden;
  contain: paint;
  max-width: 100vw;
}

.login-body::before {
  content: '';
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: var(--brand-gradient);
  opacity: 0.25;
  filter: blur(80px);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

.captura-wrapper {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 440px;
  padding: 36px 28px;
  position: relative;
  z-index: 10;
  color: var(--text);
}

.captura-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 100%;
  padding: 36px 28px;
  position: relative;
  z-index: 10;
  color: var(--text);
}

.login-header-brand {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand-logo {
  height: 48px;
  width: auto;
  max-width: 220px;
  display: block;
}

.login-brand-tagline {
  margin-top: 10px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.login-logo-container {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-img {
  max-width: 210px;
  height: auto;
}

.login-tagline {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.login-card-link:hover {
  color: var(--link-hover);
}

/* Code Box & Key Box Display */
.code-box {
  background-color: #0F172A;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  color: #E2E8F0;
  font-family: monospace;
  overflow-x: auto;
}

.code-box-header {
  background-color: #1E293B;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: #A9B6D6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.key-box-display {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: monospace;
  word-break: break-all;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-desc {
  font-size: 0.875rem;
  color: var(--text);
}

.activity-meta {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Responsive Table Cards System */
.table-responsive-cards {
  width: 100%;
}

/* Responsive Breakpoints */
@media (max-width: 1099px) {
  .app-sidebar {
    width: 260px;
    box-shadow: none;
    transform: translateX(-100%);
    padding-top: var(--sat);
    padding-bottom: var(--sab);
    padding-left: var(--sal);
  }

  .app-sidebar.open {
    box-shadow: 2px 0 12px rgba(11, 37, 69, 0.15);
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .app-main {
    margin-left: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .brand-logo-mark {
    display: none;
  }

  .brand-logo-full {
    display: block;
  }

  .sidebar-nav {
    align-items: stretch;
  }

  .nav-item {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 12px;
    min-height: 44px;
    text-align: left;
  }

  .nav-label {
    max-width: none;
    font-size: 0.875rem;
  }

  .sidebar-user-popover {
    left: 12px;
    right: 12px;
    bottom: 70px;
    min-width: 0;
    max-width: none;
  }

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

  .kanban-board {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .kanban-board::-webkit-scrollbar {
    display: none;
  }

  .kanban-open-columns {
    display: contents;
  }

  .kanban-closed-strips {
    display: contents;
  }

  .kanban-column,
  .kanban-closed-strip {
    flex: 0 0 85vw;
    width: 85vw;
    max-width: 340px;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    max-height: none;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .kanban-chevron-header {
    clip-path: none;
    margin-left: 0;
    overflow: hidden;
  }

  .kanban-strip-toggle {
    min-height: 52px;
  }

  .kanban-mobile-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
  }

  .kanban-card-menu-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .kanban-add-deal-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .stage-chevrons-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .stage-chevron-btn {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 8px 14px 8px 20px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .stage-chevron-btn:first-child {
    padding-left: 12px;
  }

  .global-search-container:not(.mobile-open) {
    display: none;
  }

  .mobile-search-btn {
    display: inline-flex;
  }

  .global-search-container.mobile-open {
    display: flex;
    align-items: center;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface);
    z-index: 120;
    padding: 0 16px;
    gap: 8px;
    max-width: 100vw;
  }

  .global-search-container.mobile-open .global-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .global-search-container.mobile-open .btn-mobile-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    order: 2;
    flex-shrink: 0;
  }

  .global-search-container.mobile-open .global-search-input-wrap {
    flex: 1;
    min-width: 0;
    order: 1;
  }
}

@media (max-width: 768px) {

  .app-content {
    padding: 16px max(16px, var(--sar)) max(24px, var(--sab)) max(16px, var(--sal));
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-header {
    height: auto;
    min-height: 56px;
    padding: max(10px, var(--sat)) max(16px, var(--sar)) 10px max(16px, var(--sal));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
  }

  .header-left {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
  }

  .page-title {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    line-height: 1.25;
  }

  .header-actions {
    display: contents;
  }

  .pref-controls {
    order: 2;
    margin-left: auto;
  }

  .header-action-group,
  .header-actions > .btn {
    order: 3;
    width: 100%;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-action-group .btn,
  .header-actions > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 130px;
    min-height: 44px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    padding: 8px 12px;
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    font-size: 0.875rem;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .form-control, .form-select {
    font-size: 16px !important;
    min-height: 44px;
  }

  .card {
    padding: clamp(12px, 3.5vw, 16px);
    margin-bottom: 16px;
  }

  .card-header {
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .kpi-grid {
    gap: 12px;
    margin-bottom: 20px;
  }

  .kpi-card {
    padding: 16px;
  }

  .ticket-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .ticket-filters .btn-sm {
    flex: 1 1 auto;
    min-height: 44px;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .table-container.cards-on-mobile {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .table-responsive-cards thead {
    display: none;
  }

  .table-responsive-cards,
  .table-responsive-cards tbody,
  .table-responsive-cards tr,
  .table-responsive-cards td {
    display: block;
    width: 100%;
  }

  .table-responsive-cards tbody tr {
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }

  .table-responsive-cards tbody tr:last-child {
    margin-bottom: 0;
  }

  .table-responsive-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
    font-size: 0.875rem;
    min-height: 44px;
    gap: 12px;
    color: var(--text);
    min-width: 0;
  }

  .table-responsive-cards .table-cell-value {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    overflow-wrap: anywhere;
  }

  .table-responsive-cards .badge {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .table-responsive-cards .table-link {
    overflow-wrap: anywhere;
    word-break: break-all;
    min-width: 0;
    max-width: 100%;
    text-align: right;
  }

  .lista-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .filter-search-wrap {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .filter-select-wrap {
    width: 100%;
    min-width: 0;
  }

  .filter-select-wrap select {
    width: 100%;
    min-width: 0;
  }

  .table-responsive-cards td:last-child {
    border-bottom: none;
    padding-top: 14px;
    padding-bottom: 4px;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
  }

  .table-responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex-shrink: 0;
  }

  .table-responsive-cards td[data-label=""]::before,
  .table-responsive-cards td:not([data-label])::before {
    display: none;
  }

  .table-responsive-cards td .btn-sm {
    min-height: 44px;
  }

  .table-responsive-cards td {
    white-space: normal !important;
  }

  .table-responsive-cards td > :not(.badge):not(button):not(.btn) {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    transform: translateY(100%);
  }

  .modal-backdrop.active .modal {
    transform: translateY(0);
  }

  .modal-body {
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .header-action-group .btn,
  .header-actions > .btn {
    flex: 1 1 100%;
  }

  .login-card {
    padding: 28px 18px;
  }
}

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


/* Contraste do subtítulo sobre o fundo navy (login/cadastro/captura) */
.login-header-brand .login-tagline {
  color: var(--brand-highlight);
  opacity: 0.9;
}

/* Botões de envio de formulário: o texto quebra em telas estreitas em vez de vazar */
form .btn[type="submit"] {
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}

.table-responsive-cards td > * {
  min-width: 0;
}

.badge code {
  color: inherit;
  background: transparent;
}

/* ========================================================= */
/* PLANOS v2 & TABELA COMPARATIVA (base.css)                 */
/* ========================================================= */
.sr-only-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pricing-section-wrapper {
  width: 100%;
  margin: 0 auto;
}

.pricing-selector-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.period-selector-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto;
  max-width: 100%;
}

.period-toggle-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
  border: 1px solid transparent;
  user-select: none;
}

.period-toggle-btn:hover {
  color: var(--text);
}

.period-toggle-btn:has(:checked) {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.period-discount-badge {
  display: inline-block;
  background: var(--status-success-bg);
  color: var(--status-success-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--status-success-border);
}

@media (max-width: 767px) {
  .period-selector-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-radius: var(--radius-lg);
    padding: 6px;
    gap: 6px;
    width: 100%;
    max-width: 440px;
  }
  .period-toggle-btn {
    border-radius: var(--radius-md);
    padding: 8px 10px;
    width: 100%;
    justify-content: center;
  }
}

.pricing-simulation-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 32px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.4;
}

.pricing-simulation-note .note-icon {
  color: var(--brand-blue);
  font-size: 0.95rem;
  font-weight: 700;
}

:root[data-theme="dark"] .pricing-simulation-note .note-icon,
:root[data-theme="escuro"] .pricing-simulation-note .note-icon {
  color: var(--brand-cyan);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pricing-simulation-note .note-icon {
    color: var(--brand-cyan);
  }
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

.pricing-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) and (max-width: 1099px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1100px) {
  .pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto 1fr auto;
    gap: 20px;
    align-items: stretch;
  }
  .pricing-card {
    grid-row: span 5;
    display: grid;
    grid-template-rows: subgrid;
  }
  .pricing-card-cta {
    margin-top: 0;
  }
}

.pricing-card-featured {
  border-color: var(--brand-blue);
  box-shadow: 0 10px 28px -6px rgba(0, 79, 250, 0.18);
}

.pricing-badge-slot {
  height: 26px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 1099px) {
  .pricing-badge-slot.is-empty {
    display: none;
  }
}

.pricing-badge {
  display: inline-block;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.pricing-badge-current {
  display: inline-block;
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.pricing-badge-suggested {
  display: inline-block;
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.pricing-plan-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.pricing-plan-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 52px;
  margin-bottom: 12px;
}

.pricing-card-price {
  margin-bottom: 14px;
}

.price-pane {
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 68px;
}

.pricing-section-wrapper:has(#period-1:checked) .price-pane-1,
.pricing-section-wrapper:has(#period-3:checked) .price-pane-3,
.pricing-section-wrapper:has(#period-6:checked) .price-pane-6,
.pricing-section-wrapper:has(#period-12:checked) .price-pane-12 {
  display: flex;
}

.pricing-section-wrapper:has(#period-1:checked) .cta-pane-1,
.pricing-section-wrapper:has(#period-3:checked) .cta-pane-3,
.pricing-section-wrapper:has(#period-6:checked) .cta-pane-6,
.pricing-section-wrapper:has(#period-12:checked) .cta-pane-12 {
  display: block;
}

.cta-pane {
  display: none;
  width: 100%;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.price-old {
  font-size: 0.95rem;
  color: var(--text-subtle);
  text-decoration: line-through;
  font-weight: 500;
}

.price-val {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

.price-period {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.price-subtext {
  font-size: 0.75rem;
  color: var(--status-success-text);
  font-weight: 600;
  line-height: 1.35;
  margin-top: 4px;
  min-height: 18px;
}

.pricing-card-limits {
  margin-bottom: 14px;
}

.pricing-limits-box {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-limits-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.limit-icon {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.limit-text {
  flex: 1;
  min-width: 0;
}

.pricing-card-features {
  margin-bottom: 20px;
}

.pricing-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8125rem;
}

.pricing-feat-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}

.pricing-feat-group-title:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.pricing-features-list li:not(.pricing-feat-group-title) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  line-height: 1.4;
}

.pricing-features-list li.off {
  color: var(--text-muted);
}

.chk, .crs {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.chk { background: var(--status-success-bg); color: var(--status-success-text); }
.crs { background: var(--surface-2); color: var(--text-muted); }

.pricing-card-cta {
  width: 100%;
  align-self: start;
}

.pricing-card-cta form {
  margin: 0;
  padding: 0;
  width: 100%;
}

@media (max-width: 1099px) {
  .pricing-card-cta {
    margin-top: auto;
  }
}

.btn-pricing-cta {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  text-decoration: none;
}

/* Tabela Comparativa */
.comparison-wrapper {
  width: 100%;
  margin: 0 auto;
}

.comparison-heading {
  text-align: center;
  margin-bottom: 24px;
}

.comparison-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.comparison-desktop-table-container {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.comparison-table th.th-feature {
  width: 32%;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.comparison-table th.th-plan {
  width: 17%;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text);
  position: relative;
}

.plan-th-name {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
}

.plan-th-price {
  display: block;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1099px) {
  .comparison-table th, .comparison-table td {
    padding: 10px 8px;
    font-size: 0.8125rem;
  }
  .plan-th-name {
    font-size: 0.95rem;
  }
  .plan-th-price {
    font-size: 0.75rem;
  }
}

.plan-th-badge {
  display: inline-block;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.th-plan-pro, .td-plan-pro {
  background: rgba(0, 79, 250, 0.03);
}

.tr-category th.td-category-header {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 16px;
}

.td-feature-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.td-plan-val {
  text-align: center;
  font-size: 0.875rem;
}

.status-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin: 0 auto;
}

.icon-check {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.icon-cross {
  background: var(--surface-2);
  color: var(--text-muted);
}

.val-text {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

@media (max-width: 767px) {
  .comparison-desktop-table-container {
    display: none;
  }
  .comparison-mobile-container {
    display: block;
  }
}

@media (min-width: 768px) {
  .comparison-desktop-table-container {
    display: block;
  }
  .comparison-mobile-container {
    display: none;
  }
}

.comparison-mobile-tabs {
  border: none;
  padding: 0;
  margin: 0;
}

.mobile-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.mobile-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 4px;
  font-weight: 700;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

@media (max-width: 360px) {
  .mobile-tabs-bar {
    gap: 4px;
  }
  .mobile-tab-btn {
    font-size: 0.75rem;
    padding: 8px 1px;
    letter-spacing: -0.03em;
  }
}

.comparison-mobile-tabs:has(#mpt-free:checked) label[for="mpt-free"],
.comparison-mobile-tabs:has(#mpt-pro:checked) label[for="mpt-pro"],
.comparison-mobile-tabs:has(#mpt-business:checked) label[for="mpt-business"],
.comparison-mobile-tabs:has(#mpt-enterprise:checked) label[for="mpt-enterprise"] {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
}

.mobile-plan-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
}

.comparison-mobile-container:has(#mpt-free:checked) .mobile-panel-free,
.comparison-mobile-container:has(#mpt-pro:checked) .mobile-panel-pro,
.comparison-mobile-container:has(#mpt-business:checked) .mobile-panel-business,
.comparison-mobile-container:has(#mpt-enterprise:checked) .mobile-panel-enterprise {
  display: block;
}

.mobile-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mobile-panel-header h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.mobile-panel-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-blue);
}

:root[data-theme="dark"] .mobile-panel-price,
:root[data-theme="escuro"] .mobile-panel-price {
  color: var(--brand-cyan);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mobile-panel-price {
    color: var(--brand-cyan);
  }
}

.mobile-cat-block {
  margin-bottom: 16px;
}

.mobile-cat-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.mobile-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-feat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-feat-item:last-child {
  border-bottom: none;
}

.mobile-feat-label {
  color: var(--text);
  font-weight: 500;
  padding-right: 8px;
}

.mobile-feat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-success-text);
}

.mobile-status-text.off {
  color: var(--text-muted);
}

/* ========================================================= */
/* INTEGRAÇÕES & RD STATION STYLES (base.css)                */
/* ========================================================= */
.slots-meter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slots-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.slots-meter-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.slots-meter-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.slots-meter-badge.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.slots-meter-badge.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.slots-meter-badge.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.badge-enterprise {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(8, 225, 250, 0.12);
  color: #075985;
  border: 1px solid rgba(8, 225, 250, 0.4);
}

:root[data-theme="dark"] .badge-enterprise,
:root[data-theme="escuro"] .badge-enterprise {
  background: rgba(8, 225, 250, 0.16);
  color: var(--brand-cyan);
  border: 1px solid rgba(8, 225, 250, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-enterprise {
    background: rgba(8, 225, 250, 0.16);
    color: var(--brand-cyan);
    border: 1px solid rgba(8, 225, 250, 0.4);
  }
}

.slots-meter-track {
  height: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.slots-meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Catálogo de Integrações */
.integracoes-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.catalog-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
}

.catalog-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-card-icon.webhook {
  background: rgba(0, 79, 250, 0.12);
  color: var(--brand-blue);
}

.catalog-card-icon.api {
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal-500);
}

.catalog-card-icon.rdstation {
  background: rgba(8, 225, 250, 0.12);
  color: var(--brand-cyan);
}

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

.catalog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.catalog-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.catalog-slot-pill {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Painel RD Station */
.rd-panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.rd-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.rd-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
}

.rd-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.rd-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.rd-tab-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.rd-tab-link:hover {
  color: var(--text);
}

.rd-tab-link.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
  font-weight: 700;
}

:root[data-theme="dark"] .rd-tab-link.active,
:root[data-theme="escuro"] .rd-tab-link.active {
  color: var(--brand-cyan);
  border-bottom-color: var(--brand-cyan);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rd-tab-link.active {
    color: var(--brand-cyan);
    border-bottom-color: var(--brand-cyan);
  }
}

.rd-section-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.rd-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.rd-section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.rd-copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rd-copy-input {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* Logs de Sincronização */
.rd-logs-desktop {
  display: block;
  overflow-x: auto;
}

.rd-logs-mobile {
  display: none;
}

@media (max-width: 767px) {
  .rd-logs-desktop {
    display: none;
  }
  .rd-logs-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .rd-log-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .rd-log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
  }
  .rd-log-label {
    color: var(--text-muted);
    font-weight: 600;
  }
  .rd-log-val {
    color: var(--text);
    font-weight: 500;
    text-align: right;
  }
}

/* Resumo da Assinatura e Uso (plano.php) */
.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.plan-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.plan-summary-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.plan-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.plan-meta-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.usage-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.usage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.usage-track {
  height: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.usage-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

@media (max-width: 600px) {
  .plan-summary-meta {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Custom Accessible Checkbox for RD Station */
.rd-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
  position: relative;
  user-select: none;
  font-size: 0.875rem;
  color: var(--text);
}

.rd-checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.rd-checkbox-label:hover .rd-checkbox-custom {
  border-color: var(--brand-blue);
}

.rd-checkbox-label:has(:checked) .rd-checkbox-custom {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.rd-checkbox-label:has(:checked) .rd-checkbox-custom::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.rd-checkbox-label:has(:focus-visible) .rd-checkbox-custom {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}


/* Utilitário global: elementos marcados como ocultos nunca devem aparecer, mesmo com display definido por classe. */
.hidden,
[hidden] {
  display: none !important;
}
