/*
 * SYSTEMWARE OS Portal SPA — Stitch Enterprise Design System
 * Navy Corporativo (#0A192F), Action Sky (#0284C7 / #006194), Canvas Slate (#F8FAFC / #FFFFFF)
 * Suporte nativo a Tema Claro (Stitch Precision) e Tema Escuro (NOC Dark)
 */

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

:root {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.94);

  --brand-primary: #0284C7;
  --brand-primary-hover: #0EA5E9;
  --brand-primary-active: #0369A1;
  --brand-accent: #006194;
  --brand-hero: #0A192F;
  --brand-ink: #0F172A;
  --brand-soft: #E0F2FE;
  --brand-soft-row: #F0F9FF;
  --brand-glow: rgba(2, 132, 199, 0.18);

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;

  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-focus: #0284C7;

  --status-p0: #EF4444;
  --status-p1: #EA580C;
  --status-p2: #F59E0B;
  --status-p3: #0284C7;
  --status-ok: #10B981;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --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.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.10), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-base: #071121;
  --bg-surface: #0A192F;
  --bg-elevated: #112240;
  --bg-glass: rgba(10, 25, 47, 0.94);

  --brand-primary: #0EA5E9;
  --brand-primary-hover: #38BDF8;
  --brand-primary-active: #0284C7;
  --brand-accent: #38BDF8;
  --brand-hero: #020C1B;
  --brand-ink: #F8FAFC;
  --brand-soft: rgba(14, 165, 233, 0.16);
  --brand-soft-row: rgba(14, 165, 233, 0.10);
  --brand-glow: rgba(56, 189, 248, 0.24);

  --text-main: #F8FAFC;
  --text-muted: #CBD5E1;
  --text-subtle: #94A3B8;

  --border-subtle: #1E3354;
  --border-strong: #2B456D;
  --border-focus: #38BDF8;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

code, kbd, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   SHELL OPERACIONAL STITCH (SIDEBAR 260PX + CANVAS FLUSH)
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn.sw-menu, .sw-menu { display: none; margin-left: auto; }

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  padding: 0.35rem 0.65rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.9rem;
}

.sidebar .brand::before {
  content: "SW";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #0A192F;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

[data-theme="dark"] .sidebar .brand::before {
  background: var(--brand-primary);
  color: #FFFFFF;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.56rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  transition: var(--transition);
}

.sidebar a:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

.sidebar a.active {
  background: #0284C7;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.95rem 0.5rem 0.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.main {
  padding: 1.5rem 2rem;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-ink);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   COMPONENTES STITCH + COMPATIBILIDADE QM-
   ========================================================================== */
.qm-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0.6rem;
  display: block;
}

.qm-profile-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.1rem;
}

.qm-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.qm-profile-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.qm-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #0A192F;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.qm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.qm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.qm-chip.accent { background: var(--brand-soft); color: var(--brand-accent); border-color: #BAE6FD; }
.qm-chip.success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.qm-chip.warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.qm-chip.danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

.qm-progress-wrap {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.qm-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.qm-progress-pct {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--brand-primary);
}

.qm-progress-bg {
  height: 6px;
  border-radius: 9999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.qm-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--brand-primary);
  transition: width 0.3s ease;
}

.qm-journey-card {
  background: #0A192F;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.15rem;
  color: #FFFFFF;
}

.qm-journey-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38BDF8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.25rem;
}

.qm-journey-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.qm-journey-desc {
  font-size: 0.875rem;
  color: #CBD5E1;
  max-width: 68ch;
}

.qm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.qm-metric-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.qm-metric-tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.qm-metric-tile.accent { border-left-color: #006194; }
.qm-metric-tile.success { border-left-color: #10B981; }
.qm-metric-tile.warning { border-left-color: #F59E0B; }
.qm-metric-tile.danger { border-left-color: #EF4444; }

.qm-metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qm-metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--brand-ink);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.15;
}

.qm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.qm-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.qm-module-tile {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.qm-module-tile:hover {
  border-color: var(--brand-primary);
  background: var(--brand-soft-row);
  box-shadow: var(--shadow-md);
}

.qm-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.15rem;
}

.qm-module-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand-accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qm-module-icon.accent { background: var(--brand-soft); color: #006194; }
.qm-module-icon.success { background: #ECFDF5; color: #059669; }
.qm-module-icon.warning { background: #FFFBEB; color: #D97706; }
.qm-module-icon.danger { background: #FEF2F2; color: #DC2626; }

.qm-module-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-ink);
}

.qm-module-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Grids & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.kpi {
  font-size: 1.85rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--brand-ink);
  line-height: 1.15;
  margin: 0.3rem 0;
}

/* Data Tables Stitch */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.4rem;
}

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

th {
  background: var(--bg-base);
  color: var(--text-subtle);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--bg-elevated);
  font-size: 0.86rem;
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--brand-soft-row); }
tbody tr:last-child td { border-bottom: none; }

/* Status Badges & SLA Scale */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.58rem;
  border-radius: 9999px;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--brand-soft);
  color: var(--brand-accent);
  border: 1px solid transparent;
}

.badge.p0, .badge.critica, .badge.rejected {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.badge.p1, .badge.alta {
  background: #FFF7ED;
  color: #9A3412;
  border-color: #FFEDD5;
}

.badge.p2, .badge.media, .badge.pending_approval {
  background: #FFFBEB;
  color: #92400E;
  border-color: #FDE68A;
}

.badge.p3, .badge.baixa {
  background: #F0F9FF;
  color: #0369A1;
  border-color: #BAE6FD;
}

.badge.ok, .badge.resolvido, .badge.fechado, .badge.aprovado, .badge.paga, .badge.active {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

/* Botões Stitch Precision */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--brand-primary);
  color: #FFFFFF;
  border: 1px solid var(--brand-primary);
  padding: 0.56rem 1.05rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn:active {
  background: var(--brand-primary-active);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.ghost {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn.ghost:hover {
  background: var(--bg-base);
  border-color: var(--border-strong);
}

.btn.danger {
  background: var(--status-p0);
  border-color: var(--status-p0);
  color: #FFFFFF;
}

.btn.danger:hover {
  background: #DC2626;
}

.btn.success {
  background: var(--status-ok);
  border-color: var(--status-ok);
  color: #FFFFFF;
}

.btn.success:hover {
  background: #059669;
}

.btn.sm {
  padding: 0.38rem 0.72rem;
  font-size: 0.76rem;
  border-radius: var(--radius-md);
}

/* Formulários & Inputs */
form.panel, .panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  max-width: 720px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0.8rem 0 0.3rem;
}

label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 0.56rem 0.78rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

/* ==========================================================================
   TELA DE LOGIN CLEAN STITCH (CENTRADA, GOOGLE-ONLY CLIENTE + STAFF APPROVAL)
   ========================================================================== */
.qm-auth-atmosphere {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 15%, rgba(2, 132, 199, 0.08), transparent 42%),
    radial-gradient(circle at 82% 85%, rgba(10, 25, 47, 0.06), transparent 44%),
    var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

.sw-login-clean {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
}

.qm-auth-card {
  position: relative;
  background: var(--bg-surface);
  color: var(--text-main);
  border-radius: var(--radius-xl);
  padding: 2rem 1.85rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 430px;
}

.sw-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.sw-login-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #0A192F;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
}

.sw-login-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  margin: 0;
}

.sw-login-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 34ch;
  line-height: 1.45;
}

.sw-corner-lock {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.sw-corner-lock:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.qm-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 0.68rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.qm-google-btn:hover {
  background: #F0F9FF;
  border-color: #0284C7;
  box-shadow: var(--shadow-md);
}

.qm-google-btn.staff-primary {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}

.qm-google-btn.staff-primary:hover {
  background: #0EA5E9;
  border-color: #0EA5E9;
}

[data-theme="dark"] .qm-google-btn {
  background: #112240;
  color: #F8FAFC;
  border-color: #2B456D;
}

.sw-role-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.25rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.sw-role-pill {
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sw-role-pill.active {
  background: var(--bg-surface);
  color: var(--brand-ink);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.sw-approval-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.sw-divider-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.55rem;
  margin-top: 0.15rem;
  border-top: 1px solid var(--border-subtle);
}

.sw-login-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.sw-login-footer a,
.sw-login-footer button {
  color: var(--text-muted);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.sw-login-footer a:hover,
.sw-login-footer button:hover {
  color: var(--brand-primary);
}

.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.notice {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.offline-banner {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.report-out {
  margin-top: 0.7rem;
  padding: 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  max-height: 260px;
  overflow: auto;
  color: var(--text-main);
}

/* ==========================================================================
   WORKBENCH SPLIT-VIEW STITCH (W_06 CENTRAL DE CHAMADOS & BANCADA)
   ========================================================================== */
.sw-toolbar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sw-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sw-search-input {
  max-width: 420px;
  min-width: 220px;
}

.sw-split-desk {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  align-items: start;
}

.sw-split-queue {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sw-queue-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.sw-queue-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.sw-queue-card.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-soft);
  background: var(--brand-soft-row);
}

.sw-sla-bar {
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-top: 0.25rem;
}

.sw-sla-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--brand-primary);
}

.sw-sla-fill.risk { background: var(--status-p1); }
.sw-sla-fill.crit { background: var(--status-p0); }
.sw-sla-fill.ok { background: var(--status-ok); }

.sw-split-inspector {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.sw-spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 0.85rem 0;
}

.sw-spec-pill {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
}

.sw-spec-pill span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.sw-spec-pill strong {
  font-size: 0.84rem;
  color: var(--brand-ink);
}

/* ==========================================================================
   APROVAÇÕES SUPER ADMIN + SUPORTE DIRETO AO CLIENTE + BANCADA W_07
   ========================================================================== */
.sw-approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.sw-approval-item {
  background: var(--bg-surface);
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sw-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sw-role-select {
  width: auto;
  min-width: 8.5rem;
  padding: 0.34rem 0.55rem;
  font-size: 0.78rem;
}

.sw-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sw-filter-bar input {
  max-width: 24rem;
}

.sw-support-bar {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

[data-theme="dark"] .sw-support-bar {
  background: rgba(2, 132, 199, 0.14);
  border-color: #1E3A5F;
}

.qm-lifecycle-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 0.45rem;
  margin: 0.85rem 0;
}

.qm-step-pill {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.qm-step-pill.done {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.qm-step-pill.current {
  background: var(--brand-soft);
  border-color: var(--brand-primary);
  color: var(--brand-accent);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.qm-csat-box {
  background: var(--bg-base);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: 0.9rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sw-reassure {
  background: var(--brand-soft-row);
  color: var(--brand-ink);
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-lg);
  padding: 0.68rem 0.95rem;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  font-weight: 600;
}

[data-theme="dark"] .sw-reassure {
  border-color: #1E3A5F;
}

.sw-assist { display: flex; flex-direction: column; gap: 1.05rem; }

.sw-kicker {
  color: var(--brand-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.sw-hero h1 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); letter-spacing: -0.025em; line-height: 1.18; max-width: 26ch; }
.sw-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.sw-plan {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.05rem 0.5rem;
  box-shadow: var(--shadow-sm);
}
.sw-plan.featured { border-color: var(--brand-primary); box-shadow: 0 0 0 2px var(--brand-soft); }
.sw-plan h2 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.sw-plan ul { margin: 0 0 0.75rem 1rem; color: var(--text-muted); font-size: 0.86rem; }
.sw-plan li + li { margin-top: 0.3rem; }
.sw-layout { display: grid; grid-template-columns: minmax(290px, 0.92fr) minmax(300px, 1.08fr); gap: 1rem; align-items: start; }
.sw-layout.staff { grid-template-columns: 1fr; }
.sw-wizard h2, .sw-section { margin-bottom: 0.35rem; }
.sw-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 0.2rem; }
.sw-choices span { width: 100%; font-size: 0.72rem; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
.sw-choices button {
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  color: var(--text-main);
  border-radius: 9999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.sw-choices button:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
.sw-choices button.on { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.sw-promise { color: var(--text-muted); font-size: 0.84rem; margin: 0.7rem 0; }
.sw-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.sw-card header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.sw-card h3 { margin: 0.35rem 0 0.6rem; font-size: 1.02rem; }
.sw-who { margin: 0.15rem 0 0.65rem; font-size: 0.86rem; font-weight: 600; color: var(--text-main); }
.sw-timeline { list-style: none; display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.35rem; }
.sw-timeline li {
  flex: 1 0 auto;
  min-width: 5.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sw-timeline li span {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.sw-timeline li.done span, .sw-timeline li.now span { background: var(--brand-primary); color: #fff; }
.sw-timeline li.now { color: var(--brand-primary); }

.sw-visit { display: flex; flex-direction: column; gap: 0.8rem; max-width: 440px; }
.sw-visit-card {
  background: #0A192F;
  color: #F8FAFC;
  border-radius: var(--radius-xl);
  padding: 1.3rem 1.3rem 1.15rem 1.45rem;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid #0284C7;
}
.sw-visit-brand { color: #38BDF8; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; margin-bottom: 0.8rem; }
.sw-visit-card h2 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.35rem; }
.sw-visit-role { color: #93C5FD; font-weight: 700; margin-bottom: 0.9rem; }
.sw-visit-line, .sw-visit-phone { color: #E2E8F0; }
.sw-visit-site { color: #38BDF8; font-weight: 700; margin-top: 0.8rem; }
.sw-visit-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sw-visit-themes { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.sw-card-preview { width: 100%; border-radius: var(--radius-lg); background: #fff; }
.sw-route { width: 100%; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.sw-route label { display: flex; gap: 0.35rem; align-items: center; font-size: 0.8rem; font-weight: 700; }
.sw-route select { min-width: 9rem; }
.sw-legend { margin-top: -0.2rem; }
.sw-legend li { color: var(--text-main); }
.sw-legend li span { background: #0A192F; color: #fff; }
.sw-call {
  margin-top: 0.7rem;
  background: var(--brand-soft-row);
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: 0.8rem;
}
[data-theme="dark"] .sw-call { border-color: #1E3A5F; }
.sw-call p { color: var(--text-main); margin: 0.25rem 0 0.55rem; font-size: 0.85rem; }
.sw-asks, .sw-call { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sw-call strong, .sw-call p { width: 100%; }
.sw-reply { width: 100%; flex: 1 0 100%; margin-bottom: 0.35rem; }
.sw-empty {
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.sw-empty strong { display: block; margin-bottom: 0.3rem; }
.sw-empty p { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.875rem; }
.sw-dock { display: none; }
.sw-acc { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
.sw-acc legend { font-weight: 700; font-size: 0.8rem; width: 100%; margin-bottom: 0.2rem; }
.sw-acc label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 500; font-size: 0.84rem; }
.sw-acc input[type="checkbox"] { width: auto; }
.sw-bench { width: 100%; margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.sw-promised { background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.65rem 0.75rem; font-size: 0.84rem; }
.sw-photos, .sw-estimate, .sw-estimate-form, .sw-pickup, .sw-yesno, .sw-stars { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: stretch; }
.sw-estimate div, .sw-photo { flex: 1 1 7rem; background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.55rem; }
.sw-estimate span, .sw-photo figcaption { display: block; font-size: 0.72rem; font-weight: 700; color: var(--text-subtle); }
.sw-photo img { width: 100%; height: 92px; object-fit: cover; border-radius: 6px; background: var(--bg-elevated); }
.sw-photo-add input { display: block; max-width: 100%; margin-top: 0.35rem; }
.sw-stars .sw-star { min-width: 2.2rem; }
.sw-stars .sw-star.on { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.sw-note-done { font-weight: 700; }

/* Responsividade Mobile & Tablet */
@media (max-width: 1024px) {
  .sw-split-desk { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    height: auto;
    position: relative;
    padding: 0.9rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .btn.sw-menu, .sw-menu { display: inline-flex; }
  .sidebar nav { display: none; }
  .sidebar.is-open nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.5rem;
  }
  .sidebar a { padding: 0.42rem 0.7rem; font-size: 0.8rem; }
  .main { padding: 1.1rem; padding-bottom: 5.5rem; }
  .sw-plans, .sw-layout { grid-template-columns: 1fr; }
  .sw-dock {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
  }
  .sw-dock a {
    text-align: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.5rem 0.2rem;
    border-radius: var(--radius-md);
  }
  .sw-dock a.active { background: var(--brand-soft); color: var(--brand-primary); font-weight: 700; }
}

@media (max-width: 480px) {
  .qm-auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-lg);
  }
  .sw-login-title {
    font-size: 1.15rem;
  }
  .sw-corner-lock {
    top: 0.75rem;
    right: 0.75rem;
  }
}
