@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Google Stitch Official Design Tokens */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --stitch-primary: #1e3a8a;
  --stitch-primary-deep: #00236f;
  --stitch-secondary: #0d9488;
  --stitch-secondary-deep: #006a61;
  --stitch-tertiary: #059669;
  --stitch-warning: #d97706;
  --stitch-danger: #dc2626;

  --stitch-surface: #faf8ff;
  --stitch-surface-low: #f2f3ff;
  --stitch-surface-container: #eaedff;
  --stitch-surface-high: #e2e7ff;
  --stitch-surface-highest: #dae2fd;
  --stitch-on-surface: #131b2e;
  --stitch-on-surface-variant: #444651;

  /* Default Application Theme = Google Stitch Light Enterprise */
  --bg-main: #faf8ff;
  --bg-sidebar: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --border: #e2e8f0;
  --border-focus: #1e3a8a;
  --primary: #1e3a8a;
  --primary-hover: #00236f;
  --accent: #0d9488;
  --accent-gradient: linear-gradient(135deg, #1e3a8a 0%, #0d9488 100%);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --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 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --input-bg: #ffffff;
  --input-text: #0f172a;
  --table-row-hover: #f8fafc;
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-sidebar: #0d121f;
  --bg-surface: rgba(17, 24, 39, 0.85);
  --bg-surface-elevated: #161f33;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #1e3a8a;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #14b8a6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #14b8a6 100%);
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --input-bg: #0d121f;
  --input-text: #ffffff;
  --table-row-hover: rgba(255, 255, 255, 0.03);
}

.panel,
.metric-card,
.modal-card,
.topbar,
.sidebar,
.global-search-dropdown,
.kb-suggestion-box {
  background: var(--bg-surface-elevated);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .topbar {
  background: rgba(13, 18, 31, 0.95);
}

/* Ícones Oficiais do Google Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  vertical-align: middle;
}

/* Inputs e Formulários - Google Stitch Design System */
input,
select,
textarea {
  background-color: #ffffff;
  color: #131b2e;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cbd5e1;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #ffffff;
  border-color: #00236f !important;
  box-shadow: 0 0 0 3px rgba(0, 35, 111, 0.12) !important;
  outline: none !important;
}

input[readonly],
select[disabled],
textarea[readonly] {
  background-color: #f2f3ff !important;
  border-color: #eaedff !important;
  color: #00236f !important;
  cursor: default;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background-color: #1e293b;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* ==================================================== */
/* GOOGLE STITCH FORM & MODAL HARMONIZATION            */
/* ==================================================== */

.modal-card .form-input,
.modal-card input:not([type="checkbox"]):not([type="radio"]),
.modal-card select,
.modal-card textarea,
.search-toolbar-input {
  background-color: #ffffff !important;
  color: #131b2e !important;
  border: 1px solid #c4c6d0 !important;
  border-radius: 8px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  padding: 9px 12px !important;
  box-shadow: inset 0 1px 2px rgba(0, 35, 111, 0.04) !important;
  transition: all 0.15s ease !important;
}

.modal-card .form-input:focus,
.modal-card input:not([type="checkbox"]):not([type="radio"]):focus,
.modal-card select:focus,
.modal-card textarea:focus,
.search-toolbar-input:focus {
  background-color: #ffffff !important;
  color: #131b2e !important;
  border-color: #00236f !important;
  box-shadow: 0 0 0 3px rgba(0, 35, 111, 0.15) !important;
  outline: none !important;
}

.modal-card .form-input::placeholder,
.modal-card input::placeholder,
.modal-card textarea::placeholder,
.search-toolbar-input::placeholder {
  color: #74777f !important;
}

.modal-card div[style*="border-radius: 8px"][style*="border: 1px solid"],
.modal-card div[style*="border: 1px solid var(--border)"] {
  background: #f8f9fe !important;
  border: 1px solid #eaedff !important;
  border-radius: 10px !important;
}

.modal-card label,
.form-group label {
  color: #444651 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .modal-card .form-input,
[data-theme="dark"] .modal-card input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .modal-card select,
[data-theme="dark"] .modal-card textarea,
[data-theme="dark"] .search-toolbar-input {
  background-color: #161f33 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .modal-card .form-input:focus,
[data-theme="dark"] .modal-card input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] .modal-card select:focus,
[data-theme="dark"] .modal-card textarea:focus,
[data-theme="dark"] .search-toolbar-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .modal-card div[style*="border-radius: 8px"][style*="border: 1px solid"],
[data-theme="dark"] .modal-card div[style*="border: 1px solid var(--border)"] {
  background: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .modal-card label,
[data-theme="dark"] .form-group label {
  color: #cbd5e1 !important;
}

.tenant-pill {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

[data-theme="dark"] .tenant-pill {
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  background-color: #00236f !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-weight: 600 !important;

  box-shadow: 0 1px 2px 0 rgba(0, 35, 111, 0.2);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--stitch-primary-deep) !important;
  box-shadow: 0 2px 4px 0 rgba(0, 35, 111, 0.3);
}

.btn-secondary {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
}

.btn-secondary:hover {
  background: #f1f5f9 !important;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .data-table th {
  background: #111827;
}

.data-table td {
  border-bottom: 1px solid var(--border);
}

.nav-item {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--stitch-primary);
}

.nav-item.active {
  background: var(--stitch-primary) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 35, 111, 0.15);
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-item.active {
  background: var(--stitch-primary) !important;
  color: #ffffff !important;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Layout Estrutural */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Sidebar Lateral - Google Stitch UI */
.sidebar {
  width: 260px;
  background-color: #ffffff;
  border-right: 1px solid #eaedff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

[data-theme="dark"] .sidebar {
  background-color: #0d121f;
  border-right-color: rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eaedff;
}

[data-theme="dark"] .sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00236f 0%, #006a61 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 35, 111, 0.25);
}

.logo-text h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #131b2e;
}

[data-theme="dark"] .logo-text h2 {
  color: #f8fafc;
}

.logo-text span {
  font-size: 11px;
  font-weight: 700;
  color: #006a61;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #444651;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: #f2f3ff;
  color: #00236f;
}

.nav-item.active {
  background: #eaedff !important;
  color: #00236f !important;
  border-color: #dae2fd !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 35, 111, 0.08);
}

[data-theme="dark"] .nav-item {
  color: #94a3b8;
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

.nav-item .icon {
  font-size: 16px;
}

/* Área Principal */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #faf8ff;
}

[data-theme="dark"] .main-wrapper {
  background: #090d16;
}

/* Topbar Header */
.topbar {
  height: 72px;
  border-bottom: 1px solid #eaedff;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

[data-theme="dark"] .topbar {
  background: rgba(13, 18, 31, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.tenant-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f2f3ff;
  border: 1px solid #eaedff;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #131b2e;
  white-space: nowrap;
  max-width: 320px;
}

.tenant-pill.msp {
  background: #eaedff;
  border-color: #dae2fd;
  color: #00236f;
}

[data-theme="dark"] .tenant-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

[data-theme="dark"] .tenant-pill.msp {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.tenant-pill .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.user-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.role-admin { background: #fee2e2; color: #b91c1c; }
.role-supervisor { background: #fef3c7; color: #b45309; }
.role-technician { background: #ccfbf1; color: #0f766e; }
.role-manager { background: #eaedff; color: #00236f; }
.role-final_user { background: #dcfce7; color: #15803d; }

[data-theme="dark"] .role-admin { background: rgba(239, 68, 68, 0.15); color: #f87171; }
[data-theme="dark"] .role-supervisor { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .role-technician { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
[data-theme="dark"] .role-manager { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
[data-theme="dark"] .role-final_user { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: #f2f3ff;
  border: 1px solid #dae2fd;
  color: #00236f;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: #eaedff;
  border-color: #00236f;
}

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #90a8ff;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-profile-quick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: #f2f3ff;
  border: 1px solid #dae2fd;
  color: #131b2e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-profile-quick:hover {
  background: #eaedff;
  color: #00236f;
}

[data-theme="dark"] .btn-profile-quick {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

[data-theme="dark"] .btn-profile-quick:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: #be123c;
  border-color: #be123c;
  color: #ffffff;
}

[data-theme="dark"] .logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

[data-theme="dark"] .logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Conteúdo Principal */
.content-area {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 35, 111, 0.04);
}

[data-theme="dark"] .section-header {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #00236f;
}

[data-theme="dark"] .section-title {
  color: #f8fafc;
}

.section-subtitle {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #444651;
  margin-top: 4px;
}

[data-theme="dark"] .section-subtitle {
  color: #94a3b8;
}


/* Grid de Métricas / Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 35, 111, 0.04);
  transition: all 0.2s ease;
}

[data-theme="dark"] .metric-card {
  background: var(--bg-surface-elevated);
  border-color: var(--border);
}

.metric-card:hover {
  border-color: #00236f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 35, 111, 0.08);
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: #444651;
  margin-bottom: 8px;
}

[data-theme="dark"] .metric-label {
  color: #94a3b8;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: #131b2e;
  letter-spacing: -0.5px;
}

[data-theme="dark"] .metric-value {
  color: #f8fafc;
}

.metric-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

/* Tabelas e Paineis */
.panel {
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 35, 111, 0.04);
  margin-bottom: 32px;
}

[data-theme="dark"] .panel {
  background: var(--bg-surface);
  border-color: var(--border);
}

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

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #131b2e;
}

[data-theme="dark"] .panel-title {
  color: #f8fafc;
}

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

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #444651;
  background: #f2f3ff;
  border-bottom: 1px solid #eaedff;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .data-table th {
  background: #111827;
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.data-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid #f2f3ff;
  color: #131b2e;
}

[data-theme="dark"] .data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.data-table tr:hover td {
  background: #faf8ff;
}

[data-theme="dark"] .data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.badge.success { background: #dcfce7; color: #15803d; }
.badge.info { background: #ccfbf1; color: #0f766e; }

[data-theme="dark"] .badge.success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="dark"] .badge.info { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

/* Botões de Ação */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-primary {
  background: #00236f !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 35, 111, 0.25) !important;
}

.btn-primary:hover {
  background: #00174c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 35, 111, 0.35) !important;
}

.btn-secondary {
  background: #ffffff !important;
  border: 1px solid #eaedff !important;
  color: #444651 !important;
}

.btn-secondary:hover {
  background: #f2f3ff !important;
  color: #00236f !important;
}

[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Modais */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(19, 27, 46, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px -10px rgba(0, 35, 111, 0.15);
  animation: fadeIn 0.25s ease;
  position: relative;
  color: #131b2e;
}

[data-theme="dark"] .modal-card {
  background: var(--bg-surface-elevated);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

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

/* Botão de Fechar com Alta Visibilidade */
.modal-close,
.modal-close-prominent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.modal-close:hover,
.modal-close-prominent:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: scale(1.08);
}

.modal-close:active,
.modal-close-prominent:active {
  transform: scale(0.95);
}

/* ==================================================== */
/* ESTILOS DA FEATURE 002: CICLO DE VIDA DE CHAMADOS   */
/* ==================================================== */

.ticket-protocol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #00236f;
  background: #eaedff;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #dae2fd;
  font-size: 13px;
  display: inline-block;
  letter-spacing: 0.3px;
}

/* Status Badges com Alto Contraste */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-new {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.status-in_progress, .status-in_triage, .status-assigned {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-pending_customer {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.status-resolved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-closed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Prioridades */
.prio-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-block;
}

.prio-low {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.prio-normal {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.prio-urgent {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Filtros de Chamados */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

.filter-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.filter-btn.active {
  background: #0047ba;
  color: #ffffff;
  border-color: #0047ba;
}

/* Timeline de Mensagens Moderna Stitch */
.ticket-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.timeline-message {
  padding: 14px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0047ba;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.timeline-message.timeline-user {
  background: #f8faff;
  border-left-color: #0284c7;
}

.timeline-message.timeline-tech {
  background: #ffffff;
  border-left-color: #0047ba;
}

.timeline-message.timeline-solution {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  border-color: #bbf7d0;
  color: #14532d;
}

.timeline-internal {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  border-color: #fde68a;
  color: #78350f;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #64748b;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 6px;
}

.timeline-meta strong {
  color: #0f172a;
  font-size: 13px;
}

.timeline-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  white-space: pre-line;
  word-break: break-word;
}

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
}

.badge-role-tech {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-role-user {
  background: #e6f7f5;
  color: #006a61;
  border: 1px solid #ccfbf1;
}

.timeline-badge-internal {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.timeline-badge-solution {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Base de Conhecimento em Linha */
.kb-suggestion-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 10px;
  display: none;
}

.kb-suggestion-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kb-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.kb-item:hover {
  background: rgba(6, 182, 212, 0.2);
}

/* CSAT Rating Stars */
.csat-rating-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #475569;
  transition: transform 0.15s, color 0.15s;
}

.star-btn.active, .star-btn:hover {
  color: #f59e0b;
  transform: scale(1.2);
}

.feedback-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==================================================== */
/* ESTILOS DA FEATURE 003: MOTOR DE SLA COMERCIAL       */
/* ==================================================== */

.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.sla-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sla-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: pulseSlaAlert 1.5s infinite;
}

.sla-breached {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sla-paused {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

@keyframes pulseSlaAlert {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.sla-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sla-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sla-kpi-title {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.sla-kpi-val {
  font-size: 20px;
  font-weight: 800;
}

/* ==================================================== */
/* ESTILOS DA FEATURE 004: CONTRATOS E FATURAMENTO     */
/* ==================================================== */

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-ok {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.progress-warn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.statement-box {
  background: #0d121f;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.statement-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.statement-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  padding-top: 12px;
}

.statement-total-highlight {
  color: var(--accent);
  font-size: 18px;
}

/* Estilos da Feature 005: Ativos de TI & WinAudit */
.asset-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.asset-type-workstation {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.asset-type-notebook {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.asset-type-server {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.asset-type-network {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.asset-type-printer {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.asset-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.asset-spec-card {
  background: #0d121f;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-spec-card .spec-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.asset-spec-card .spec-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================================================== */
/* 5 BLOCOS DE TELEMETRIA ESTENDIDA (REVERSA 010 / E001) */
/* ==================================================== */
.asset-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.asset-block-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

[data-theme="light"] .asset-block-panel {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.asset-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .asset-block-header {
  border-bottom-color: #e2e8f0;
}

.asset-block-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="light"] .asset-block-title {
  color: #2563eb;
}

.asset-audit-badge {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

[data-theme="light"] .asset-audit-badge {
  background: #edf2f7;
  border-color: #cbd5e1;
  color: #475569;
}

.asset-audit-badge strong {
  color: var(--text);
}

.asset-block-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.asset-block-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.asset-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.asset-field-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="light"] .asset-field-label {
  color: #64748b;
}

.asset-field-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-field-value.value-highlight {
  color: #38bdf8;
  font-weight: 700;
}

[data-theme="light"] .asset-field-value.value-highlight {
  color: #0284c7;
}

.asset-field-value.value-uptime {
  color: #34d399;
  font-weight: 700;
}

[data-theme="light"] .asset-field-value.value-uptime {
  color: #059669;
}

.asset-field-value.value-accent {
  color: #818cf8;
  font-weight: 700;
}

[data-theme="light"] .asset-field-value.value-accent {
  color: #4f46e5;
}

.asset-field-value code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

[data-theme="light"] .asset-field-value code {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.asset-section-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 10px 0 6px 0;
  letter-spacing: 0.5px;
}

[data-theme="light"] .asset-section-subtitle {
  color: #475569;
}

.asset-disks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.asset-disk-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

[data-theme="light"] .asset-disk-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.asset-disk-card:hover {
  border-color: var(--primary);
}

.asset-disk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-disk-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.asset-disk-type-pill {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
}

[data-theme="light"] .asset-disk-type-pill {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.asset-disk-status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .asset-disk-status-badge {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.asset-disk-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.asset-badge-account {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

[data-theme="light"] .asset-badge-account {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.asset-badge-admin {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-weight: 700;
}

[data-theme="light"] .asset-badge-admin {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.dropzone-winaudit {
  border: 2px dashed var(--border);
  background: rgba(13, 18, 31, 0.6);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-winaudit:hover,
.dropzone-winaudit.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.asset-disk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 6px;
}

.ticket-asset-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==================================================== */
/* BUSCA GLOBAL E BARRAS DE FERRAMENTAS DE PESQUISA     */
/* ==================================================== */

.global-search-container {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.global-search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f2f3ff;
  border: 1px solid #dae2fd;
  border-radius: 8px;
  padding: 0 14px;
  transition: all 0.2s ease;
}

.global-search-wrapper:focus-within {
  border-color: #00236f;
  box-shadow: 0 0 0 3px rgba(0, 35, 111, 0.12);
  background: #ffffff;
}

.global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #131b2e;
  font-size: 13.5px;
  font-family: inherit;
  height: 40px;
}

.global-search-input::placeholder {
  color: #757682;
}

.search-kbd {
  font-size: 11px;
  font-weight: 700;
  color: #264191;
  background: #e2e7ff;
  border: 1px solid #c5c5d3;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
  pointer-events: none;
  user-select: none;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 35, 111, 0.08);
  max-height: 440px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

[data-theme="dark"] .global-search-wrapper {
  background: #161f33;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .global-search-wrapper:focus-within {
  background: #10172a;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .global-search-input {
  color: #ffffff;
}

[data-theme="dark"] .global-search-input::placeholder {
  color: #94a3b8;
}

[data-theme="dark"] .search-kbd {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

[data-theme="dark"] .global-search-dropdown {
  background: #0d121f;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-category-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #006a61;
  padding: 8px 14px;
  letter-spacing: 0.6px;
  background: #e6f6f4;
  border-top: 1px solid #eaedff;
  border-bottom: 1px solid #eaedff;
}

[data-theme="dark"] .search-category-title {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-category-title:first-child {
  border-top: none;
}

.search-result-item {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f9;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  background: transparent;
}

.search-result-item:hover,
.search-result-item.selected {
  background: #f0f3ff;
  border-left-color: #00236f;
}

[data-theme="dark"] .search-result-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .search-result-item.selected {
  background: rgba(99, 102, 241, 0.2);
  border-left-color: #818cf8;
}

.search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.search-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #131b2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .search-item-title {
  color: #f1f5f9;
}

.search-item-subtitle {
  font-size: 12px;
  color: #5d606e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .search-item-subtitle {
  color: #94a3b8;
}

.search-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: #757682;
  font-size: 13.5px;
}

[data-theme="dark"] .search-empty {
  color: #94a3b8;
}

/* Barra de Pesquisa nas Abas */
.search-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-toolbar-input {
  background: rgba(13, 18, 31, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-toolbar-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* ==================================================== */
/* FEATURE 006: GERENCIAMENTO DE USUÁRIOS E AÇÕES CRUD  */
/* ==================================================== */

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

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

.user-details strong {
  color: var(--text);
  font-size: 13.5px;
}

.user-details span {
  font-size: 12px;
  color: var(--text-muted);
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-action-sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-sm.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-action-sm.success:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge.inactive {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* KB Article Preview */
.kb-article-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  margin-top: 16px;
  max-height: 450px;
  overflow-y: auto;
}

[data-theme="light"] .kb-article-content {
  background: #f8fafc;
  color: #1e293b;
}

.kb-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* ==================================================== */
/* FEATURE 012: RELATÓRIOS & ANALYTICS OFENSORES         */
/* ==================================================== */
.analytics-ranking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.analytics-ranking-1 {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.analytics-ranking-2 {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.analytics-ranking-3 {
  background: rgba(217, 119, 6, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.analytics-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

[data-theme="light"] .analytics-progress-bar {
  background: #e2e8f0;
}

.analytics-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-gradient);
  transition: width 0.4s ease;
}

/* ==================================================== */
/* CARDS DE PATRIMÔNIO & EQUIPAMENTOS TI                */
/* ==================================================== */

.view-mode-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-mode-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.patrimonio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.patrimonio-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.patrimonio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.patrimonio-card.type-notebook::before { background: linear-gradient(90deg, #6366f1, #06b6d4); }
.patrimonio-card.type-workstation::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.patrimonio-card.type-server::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.patrimonio-card.type-network_device::before { background: linear-gradient(90deg, #10b981, #14b8a6); }
.patrimonio-card.type-printer::before { background: linear-gradient(90deg, #a855f7, #ec4899); }

.patrimonio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
  border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .patrimonio-card {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .patrimonio-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.patrimonio-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.patrimonio-tag-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="light"] .patrimonio-tag-badge {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #a5b4fc;
}

.patrimonio-card-identity {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.patrimonio-avatar-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

[data-theme="light"] .patrimonio-avatar-icon {
  background: #f1f5f9;
}

.patrimonio-identity-details {
  flex: 1;
  min-width: 0;
}

.patrimonio-hostname {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

.patrimonio-brand-model {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
}

.patrimonio-serial-line {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 4px;
}

.patrimonio-specs-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

[data-theme="light"] .patrimonio-specs-pill-grid {
  background: #f8fafc;
}

.patrimonio-spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patrimonio-spec-item span.icon {
  font-size: 13px;
  min-width: 14px;
}

.patrimonio-spec-item strong {
  color: var(--text);
  font-weight: 600;
}

.patrimonio-allocation-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.patrimonio-allocation-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.patrimonio-allocation-line strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.patrimonio-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   GOOGLE STITCH ENHANCEMENTS & UTILITIES (CS HelpDesk Pro)
   ========================================================================== */

/* Tipografia Mono para Hardware, Seriais e Patrimônio */
.mono-code,
.patrimonio-code,
.tag-serial,
.ticket-id-badge {
  font-family: var(--font-mono) !important;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* Sidebar Collapsible Mode (16rem expanded / 4.5rem collapsed) */
.app-layout.sidebar-collapsed .sidebar,
.app-container.sidebar-collapsed .sidebar {
  width: 4.5rem !important;
  min-width: 4.5rem !important;
}

.app-layout.sidebar-collapsed .sidebar .brand-text,
.app-layout.sidebar-collapsed .sidebar .logo-text,
.app-layout.sidebar-collapsed .sidebar .nav-item span:not(.icon),
.app-layout.sidebar-collapsed .sidebar .nav-section-title,
.app-layout.sidebar-collapsed .sidebar .user-info-text {
  display: none !important;
}

.app-layout.sidebar-collapsed .sidebar .sidebar-header {
  justify-content: center !important;
  padding: 14px 0 !important;
}

.app-layout.sidebar-collapsed .sidebar .sidebar-toggle-btn {
  display: none !important;
}

.app-layout.sidebar-collapsed .sidebar .logo-icon {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-layout.sidebar-collapsed .sidebar .logo-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.app-layout.sidebar-collapsed .sidebar .nav-item {
  justify-content: center !important;
  padding: 10px 0 !important;
  text-align: center;
}

.app-layout.sidebar-collapsed .sidebar .nav-item .icon {
  margin: 0 !important;
  font-size: 1.25rem;
}

.sidebar-topbar-toggle-btn:hover {
  background: rgba(0, 35, 111, 0.08) !important;
  color: #00236f !important;
  border-color: #00236f !important;
}

[data-theme="dark"] .sidebar-topbar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Stitch Elevated Cards */
.stitch-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stitch-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(30, 58, 138, 0.3);
}

/* Badges e Chips Não-Pílula (4px radius) */
.stitch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stitch-badge-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.stitch-badge-maintenance {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.stitch-badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.stitch-badge-transit {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Botões do Stitch */
.btn-stitch-primary {
  background-color: var(--stitch-primary) !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s ease;
}

.btn-stitch-primary:hover {
  background-color: var(--stitch-primary-deep) !important;
}

.btn-stitch-secondary {
  background-color: #ffffff !important;
  color: var(--stitch-on-surface) !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease;
}

.btn-stitch-secondary:hover {
  background-color: #f1f5f9 !important;
}

/* ========================================================
   FEATURE 015: CADASTRO E TOMBAMENTO DE EQUIPAMENTOS (STITCH)
   ======================================================== */

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* ==========================================================================
   FEATURE 015 - GOOGLE STITCH PATRIMÔNIO ENTERPRISE DESIGN SYSTEM
   ========================================================================== */

.stitch-workspace {
  background-color: #faf8ff;
  padding: 1.5rem 2rem 4rem 2rem;
  max-width: 1480px;
  margin: 0 auto;
  font-family: var(--font-sans);
}

[data-theme="dark"] .stitch-workspace {
  background-color: #090d16;
}

/* Header & Breadcrumb Toolbar */
.stitch-header-card {
  margin-bottom: 1.5rem;
}

.stitch-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #444651;
  margin-bottom: 0.625rem;
}

[data-theme="dark"] .stitch-breadcrumb {
  color: #94a3b8;
}

.stitch-breadcrumb a {
  color: #444651;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.stitch-breadcrumb a:hover {
  color: #00236f;
}

[data-theme="dark"] .stitch-breadcrumb a:hover {
  color: #60a5fa;
}

.stitch-title-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stitch-title-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #006a61;
  display: inline-block;
  flex-shrink: 0;
}

.stitch-page-title {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0;
  color: #131b2e;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .stitch-page-title {
  color: #f8fafc;
}

.stitch-page-subtitle {
  font-size: 0.8125rem;
  color: #444651;
  margin: 4px 0 0 0;
}

[data-theme="dark"] .stitch-page-subtitle {
  color: #94a3b8;
}

/* Stepper Tabs Bar (Pills Flutuantes) */
.stitch-steps-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding: 2px 0;
}

.stitch-step-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #444651;
  text-decoration: none;
  background: transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

[data-theme="dark"] .stitch-step-item {
  color: #94a3b8;
}

.stitch-step-item:hover {
  background: #eef0fb;
  color: #00236f;
}

[data-theme="dark"] .stitch-step-item:hover {
  background: #1e293b;
  color: #f8fafc;
}

.stitch-step-item.active {
  background: #eaedff;
  color: #00236f;
  font-weight: 700;
}

[data-theme="dark"] .stitch-step-item.active {
  background: #1e3a8a;
  color: #ffffff;
}

.stitch-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e7ff;
  color: #444651;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
}

.stitch-step-item.active .stitch-step-num {
  background: #00236f;
  color: #ffffff;
}

[data-theme="dark"] .stitch-step-num {
  background: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .stitch-step-item.active .stitch-step-num {
  background: #ffffff;
  color: #00236f;
}

/* 12-Column Grid Layout */
.stitch-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.stitch-col-8 {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stitch-col-4 {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 1.5rem;
}

@media (max-width: 1100px) {
  .stitch-col-8,
  .stitch-col-4 {
    grid-column: span 12;
    position: static;
  }
}

/* Section Cards */
.stitch-section-card {
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px -2px rgba(0, 35, 111, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .stitch-section-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

.stitch-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f2f3ff;
  padding-bottom: 0.875rem;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .stitch-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.stitch-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #eaedff;
  color: #00236f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .stitch-icon-box {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.stitch-section-h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0;
  color: #131b2e;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .stitch-section-h2 {
  color: #f8fafc;
}

/* Inputs, Selects & Labels (Estilo Stitch Lilás Claro #eef0fb) */
.stitch-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #131b2e;
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

[data-theme="dark"] .stitch-label {
  color: #f1f5f9;
}

.stitch-input {
  width: 100%;
  height: 42px;
  padding: 0 0.875rem;
  background-color: #eef0fb !important;
  color: #131b2e !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.stitch-input:focus {
  background-color: #ffffff !important;
  border-color: #00236f !important;
  box-shadow: 0 0 0 3px rgba(0, 35, 111, 0.12) !important;
  outline: none !important;
}

.stitch-input-code {
  font-family: var(--font-mono) !important;
}

[data-theme="dark"] .stitch-input {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .stitch-input:focus {
  background-color: #0f172a !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

.stitch-help-text {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: block;
}

[data-theme="dark"] .stitch-help-text {
  color: #94a3b8;
}

/* Botões Segmentados (Condição Física) */
.stitch-segmented-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stitch-segment-btn {
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #eaedff;
  background: #ffffff;
  color: #444651;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stitch-segment-btn.active {
  background: #ccfbf1;
  border-color: #99f6e4;
  color: #006a61;
  font-weight: 700;
}

/* Badges & Pills */
.stitch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stitch-pill-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.stitch-pill-blue {
  background: #eaedff;
  color: #00236f;
}

.stitch-pill-amber {
  background: #fef3c7;
  color: #92400e;
}

/* Plaqueta Física de Patrimônio (Design Limpo Stitch com Código e QR) */
.stitch-metal-tag {
  background: #ffffff;
  border: 1px solid #eaedff;
  border-radius: 10px;
  padding: 1.125rem 1rem;
  box-shadow: 0 4px 16px -2px rgba(0, 35, 111, 0.06);
}

[data-theme="dark"] .stitch-metal-tag {
  background: #111827;
  border-color: #334155;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
}

.stitch-metal-tag-code {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f172a;
}

[data-theme="dark"] .stitch-metal-tag-code {
  color: #f8fafc;
}

/* Botões de Ação Stitch */
.btn-stitch-main {
  height: 40px;
  padding: 0 1.25rem;
  background-color: #00236f !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 2px 8px rgba(0, 35, 111, 0.25) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-stitch-main:hover {
  background-color: #00174c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 35, 111, 0.35) !important;
}

.btn-stitch-outline {
  height: 40px;
  padding: 0 1rem;
  background-color: #ffffff !important;
  color: #444651 !important;
  border: 1px solid #eaedff !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .btn-stitch-outline {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.btn-stitch-outline:hover {
  background-color: #eef0fb !important;
  border-color: #cbd5e1 !important;
  color: #00236f !important;
}

[data-theme="dark"] .btn-stitch-outline:hover {
  background-color: #334155 !important;
}
/* Alerta Pulsante para SLA em Risco (< 30 min) - Google Stitch UI */
@keyframes slaPulseWarning {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.sla-badge.sla-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  animation: slaPulseWarning 2s infinite ease-in-out;
}

.sla-badge.sla-breached {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* ==================================================== */
/* REGRAS DE IMPRESSÃO TÉRMICA & RELATÓRIOS             */
/* ==================================================== */
@media print {
  #stitchThermalPrintIframe {
    display: block !important;
    visibility: visible !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sidebar,
  .topbar,
  .stitch-segment-btn,
  .btn,
  .btn-primary,
  .btn-secondary,
  .modal-overlay,
  #personaMenuDropdown,
  .persona-menu,
  button {
    display: none !important;
  }

  .main-content,
  .tab-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .stitch-table-card,
  .stitch-kpi-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }
}

/* ==========================================================================
   FEATURE 041: CONSOLIDAÇÃO VISUAL E IDENTIDADE MSP (STITCH REFACTORING)
   ========================================================================== */

/* Focus Ring Acessível (WCAG 2.1 AA) */
:focus-visible {
  outline: 2px solid #00236f !important;
  outline-offset: 2px !important;
}

[data-theme="dark"] :focus-visible {
  outline-color: #818cf8 !important;
}

/* Classes Unificadas de Botão Primário e Secundário */
.btn-primary,
.stitch-btn-primary {
  background-color: #00236f !important;
  color: #ffffff !important;
  border: 1px solid #00236f !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 3px rgba(0, 35, 111, 0.2) !important;
  text-decoration: none !important;
}

.btn-primary:hover,
.stitch-btn-primary:hover {
  background-color: #00174c !important;
  border-color: #00174c !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 35, 111, 0.3) !important;
}

.btn-secondary,
.stitch-btn-secondary {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.btn-secondary:hover,
.stitch-btn-secondary:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #00236f !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .stitch-btn-secondary {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .stitch-btn-secondary:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

/* Ações de Linha Uniformizadas */
.btn-row-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  transition: all 0.15s ease !important;
  height: 30px !important;
  text-decoration: none !important;
}

.btn-row-action:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #00236f !important;
}

[data-theme="dark"] .btn-row-action {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .btn-row-action:hover {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

/* Recuo em campos de busca com lupa */
.search-input-with-lupa,
.stitch-search-input {
  padding-left: 38px !important;
}

/* Estilos da Logo Oficial na Sidebar */
.sidebar-brand-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  width: 100%;
}

.sidebar-logo-img {
  max-height: 36px;
  max-width: 175px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

[data-theme="dark"] .sidebar-logo-img {
  filter: brightness(1.15);
}

.sidebar-product-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .sidebar-product-label {
  color: #94a3b8;
}

/* Símbolo compacto quando a barra lateral está recolhida */
.sidebar-symbol-img {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #00236f;
  color: #ffffff;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(0, 35, 111, 0.3);
}

.app-layout.sidebar-collapsed .sidebar-logo-img,
.app-layout.sidebar-collapsed .sidebar-product-label {
  display: none !important;
}

.app-layout.sidebar-collapsed .sidebar-symbol-img {
  display: flex !important;
}

/* Otimização da Tabela de Chamados para 1366px e 1440px */
.ticket-subject-cell {
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

.ticket-protocol-compact {
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
}

/* ==================================================== */
/* APPLE-INSPIRED MINIMALIST DESIGN SYSTEM (Impeccable) */
/* ==================================================== */

/* Tipografia de Sistema Apple com Hierarquia Clara */
body, .app-layout, .topbar, .sidebar, .modal-card, .stitch-header-card {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Blindagem Opaca e Elegante do Dropdown de Conta */
.user-account-dropdown {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.06) !important;
  z-index: 100000 !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

[data-theme="dark"] .user-account-dropdown {
  background-color: #18181b !important;
  color: #f4f4f5 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.7), 0 4px 12px -2px rgba(0, 0, 0, 0.4) !important;
}

.user-account-dropdown a.dropdown-item-link:hover,
.user-account-dropdown a.dropdown-persona-item:hover {
  background-color: #f1f5f9 !important;
}

[data-theme="dark"] .user-account-dropdown a.dropdown-item-link:hover,
[data-theme="dark"] .user-account-dropdown a.dropdown-persona-item:hover {
  background-color: #27272a !important;
}

/* Header Cards Minimalistas estilo Apple */
.stitch-header-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 18px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .stitch-header-card {
  background: #131722;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stitch-header-card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
  line-height: 1.25;
}

[data-theme="dark"] .stitch-header-card h1 {
  color: #f8fafc;
}

.stitch-header-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .stitch-header-card p {
  color: #94a3b8;
}

/* Tenant Pill Minimalista */
.tenant-pill {
  border-radius: 10px !important;
  padding: 5px 12px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: -0.01em !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .tenant-pill {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Cards de Métricas e KPIs Refinados */
.metric-card, .stitch-kpi-card, .sla-kpi-card {
  border-radius: 14px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

[data-theme="dark"] .metric-card,
[data-theme="dark"] .stitch-kpi-card,
[data-theme="dark"] .sla-kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
}

.metric-card:hover, .stitch-kpi-card:hover, .sla-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08) !important;
}

/* ==================================================== */
/* FEATURE 043: OTIMIZAÇÃO E MINIMALISMO DE CHAMADOS   */
/* ==================================================== */

/* Protocolo Clicável com Affordance de Navegação */
.ticket-protocol-clickable {
  cursor: pointer;
  background: #eaedff;
  color: #00236f;
  border: 1px solid #dae2fd;
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  outline: none;
}

.ticket-protocol-clickable:hover {
  background: #dbe4ff;
  border-color: #b3c5ff;
  color: #00174d;
  box-shadow: 0 2px 5px rgba(0, 35, 111, 0.14);
  transform: translateY(-1px);
}

.ticket-protocol-clickable:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 35, 111, 0.1);
}

.ticket-protocol-clickable:focus-visible {
  outline: 2px solid #00236f;
  outline-offset: 2px;
}

[data-theme="dark"] .ticket-protocol-clickable {
  background: rgba(30, 58, 138, 0.25);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}

[data-theme="dark"] .ticket-protocol-clickable:hover {
  background: rgba(30, 58, 138, 0.45);
  border-color: rgba(147, 197, 253, 0.45);
  color: #bfdbfe;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Esferas Indicadoras Semânticas de SLA (Impeccable Operate) */
.sla-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  cursor: help;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sla-dot:hover {
  transform: scale(1.3);
}

/* Esfera Vermelha: SLA Estourado / Violado */
.sla-dot-breached {
  background-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

/* Esfera Amarela: SLA Vencendo (<= 30min) */
.sla-dot-warning {
  background-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  animation: pulseSlaWarningDot 1.8s infinite ease-in-out;
}

@keyframes pulseSlaWarningDot {
  0% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.08); }
  100% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4); }
}

/* Esfera Verde: SLA no Prazo / Cumprido */
.sla-dot-ok {
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Esfera Neutra: SLA Pausado ou Sem SLA */
.sla-dot-paused {
  background-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

/* Harmonização Impeccable (Modo Operate) na Linha de Chamados */
#tab-tickets .data-table tbody tr {
  transition: background-color 0.12s ease;
}

#tab-tickets .data-table tbody tr:hover td {
  background-color: #f8fafc;
}

[data-theme="dark"] #tab-tickets .data-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Badges de Status Refinados e Suaves */
.status-badge {
  box-shadow: none;
  font-weight: 600;
  border-width: 1px;
}

.status-new {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #4f46e5 !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

.status-in_progress, .status-in_triage, .status-assigned {
  background: rgba(217, 119, 6, 0.08) !important;
  color: #b45309 !important;
  border-color: rgba(217, 119, 6, 0.2) !important;
}

.status-pending_customer {
  background: rgba(234, 179, 8, 0.08) !important;
  color: #a16207 !important;
  border-color: rgba(234, 179, 8, 0.2) !important;
}

.status-resolved {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}

.status-closed {
  background: rgba(100, 116, 139, 0.08) !important;
  color: #475569 !important;
  border-color: rgba(100, 116, 139, 0.2) !important;
}

/* Prioridades Harmonizadas */
.prio-pill {
  font-weight: 600;
}

.prio-low {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}

.prio-normal {
  background: rgba(59, 130, 246, 0.08) !important;
  color: #2563eb !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

.prio-urgent {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}



