/* ==========================================================================
   CSS SYSTEM - HELPOS (PREMIUM & MOBILE-FIRST DESIGN)
   ========================================================================== */

:root {
  /* Cores HSL Harmoniosas */
  --bg-primary: hsl(222, 47%, 10%);
  --bg-secondary: hsl(222, 47%, 14%);
  --bg-glass: rgba(15, 23, 42, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  
  --primary: hsl(217, 91%, 60%);
  --primary-hover: hsl(217, 91%, 66%);
  --accent: hsl(263, 90%, 65%);
  
  --success: hsl(142, 70%, 45%);
  --success-bg: hsla(142, 70%, 45%, 0.15);
  --warning: hsl(38, 92%, 50%);
  --warning-bg: hsla(38, 92%, 50%, 0.15);
  --danger: hsl(350, 84%, 55%);
  --danger-bg: hsla(350, 84%, 55%, 0.15);
  
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 25%, 70%);
  --text-dark: hsl(222, 47%, 15%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Geral */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Estrutura Principal */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  padding: 1.2rem 1rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  max-width: 1400px; /* Base agora  1400px */
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .app-header {
    padding: 1rem 0;
  }
  .header-container {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1400px;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--primary);
  width: 28px;
  height: 28px;
}

.logo-container h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.logo-container h1 span {
  color: var(--primary);
}

.app-nav {
  display: flex;
  width: 100%;
  max-width: 400px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);

  margin-left: auto;}

.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-link i {
  width: 16px;
  height: 16px;
}

.nav-link.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Conteúdo Principal */
.app-content {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 1400px; /* Base agora  1400px tbm */
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .app-content {
    padding: 1.5rem 2rem;
  }
}

/* Abas */
.main-tab-content {
  display: none;
}

.main-tab-content.active {
  display: block;
}

.sub-tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.sub-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Welcome Banner */
.welcome-banner {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
}

.welcome-banner h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-banner p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Cards & Grid de Ações */
.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
}

.action-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: var(--transition);
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--bg-secondary) 80%, rgba(59, 130, 246, 0.05) 100%);
}

.action-card:hover::before {
  opacity: 1;
}

.card-icon {
  display: inline-flex;
  padding: 12px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  color: var(--primary);
  margin-bottom: 1rem;
}

.card-icon i {
  width: 24px;
  height: 24px;
}

.action-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.action-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.card-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.card-link i {
  width: 16px;
  height: 16px;
  transition: var(--transition);
}

.action-card:hover .card-link i {
  transform: translateX(4px);
}

/* Cabeçalhos de Seção */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-back i {
  width: 16px;
  height: 16px;
}

/* Formulários & Glassmorphism */
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.form-container {
  max-width: 650px;
  margin: 0 auto;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-section h4 {
  font-size: 1.1rem;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

@media (min-width: 600px) {
  .form-row {
    flex-direction: row;
    gap: 1.5rem;
  }
  .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem; /* iOS Safari requer mínimo de 16px (1rem) para não dar auto-zoom */
  transition: var(--transition);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input {
  flex: 1;
}

.input-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

/* Botões */
.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary i {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-secondary.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  align-self: flex-start;
}

.btn-success {
  background-color: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-success:hover {
  background-color: hsl(142, 70%, 50%);
}

.btn-full {
  width: 100%;
}

/* Alertas */
.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid;
}

.alert-success {
  background-color: var(--success-bg);
  border-color: rgba(34, 197, 94, 0.3);
  color: hsl(142, 70%, 75%);
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: hsl(350, 84%, 75%);
}

.hide {
  display: none !important;
}

/* Adicionar múltiplos problemas */
.problem-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.problem-item input {
  flex: 1;
}

.btn-remove-problem {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-radius: 8px;
  width: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-remove-problem:hover {
  background: var(--danger);
  color: white;
}

/* Acompanhamento / Timeline */
.search-container {
  max-width: 500px;
  margin: 0 auto 1.5rem auto;
}

.track-details {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease;
}

.os-info-card {
  margin-bottom: 2rem;
}

.os-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.os-info-header h3 {
  font-size: 1.4rem;
  color: var(--primary);
}

.badge {
  padding: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.status-pendente {
  background-color: rgba(234,179,8,0.15);
  color: #eab308;
  border: 1px solid rgba(234,179,8,0.3);
}

.badge.status-em-atendimento {
  background-color: rgba(59,130,246,0.15);
  color: #3b82f6;
  border: 1px solid rgba(59,130,246,0.3);
}

.badge.status-concluido {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge.status-assinado {
  background-color: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  font-size: 0.95rem;
}

@media (min-width: 500px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2.2rem;
  margin: 1.5rem 0 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 11px;
  width: 2px;
  height: 100%;
  background: var(--border-glass);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.8rem;
}

.timeline-marker {
  position: absolute;
  top: 4px;
  left: -2.2rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.timeline-marker i {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

/* Timeline status-specific markers */
.timeline-item.status-pendente .timeline-marker {
  border-color: var(--danger);
  color: var(--danger);
}
.timeline-item.status-pendente .timeline-marker i {
  color: var(--danger);
}

.timeline-item.status-em-atendimento .timeline-marker {
  border-color: var(--warning);
  color: var(--warning);
}
.timeline-item.status-em-atendimento .timeline-marker i {
  color: var(--warning);
}

.timeline-item.status-concluido .timeline-marker {
  border-color: var(--success);
  color: var(--success);
}
.timeline-item.status-concluido .timeline-marker i {
  color: var(--success);
}

.timeline-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.timeline-notes {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-glass);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
}

.timeline-notes strong {
  color: var(--primary);
}

/* Painel de Fechamento */
.closing-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 2rem;
}

.closing-card h3 {
  font-size: 1.3rem;
}

.closing-card p {
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Quadro de Assinatura */
.signature-container {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.canvas-wrapper {
  background: white;
  border-radius: 8px;
  border: 2px solid var(--primary);
  overflow: hidden;
  height: 250px;
  position: relative;
  touch-action: none; /* Necessário para touch no celular */
}

#signature-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.canvas-actions {
  display: flex;
  gap: 1rem;
}

.canvas-actions button {
  flex: 1;
}

.signature-preview-box {
  width: 100%;
  max-width: 300px;
  height: auto;
  max-height: 120px;
  border: 1px dashed var(--border-glass);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  margin: 0.5rem auto;
  display: block;
}

.signature-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ======================================= */
/* PORTAL TI & DASHBOARD                   */
/* ======================================= */

/* Login Card */
.login-card {
  max-width: 400px;
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.login-header {
  text-align: center;
}

.login-lock-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.login-header h2 {
  font-size: 1.6rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Layout Dashboard */
.tech-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tech-dashboard-layout {
    grid-template-columns: 240px 1fr;
  }
}

/* Sidebar */
.tech-sidebar {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.user-profile .avatar {
  background: rgba(59, 130, 246, 0.1);
  padding: 10px;
  border-radius: 50%;
  color: var(--primary);
}

.user-profile h4 {
  font-size: 0.95rem;
}

.user-profile span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .sidebar-nav {
    flex-direction: column;
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.sidebar-link i {
  width: 18px;
  height: 18px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.sidebar-link.active {
  color: var(--primary);
  font-weight: 600;
}

.btn-logout {
  color: var(--danger);
  margin-top: 1rem;
}

.btn-logout:hover {
  background-color: var(--danger-bg);
  color: var(--danger);
}

/* Painel de Conteúdo TI */
.tech-main-panel {
  flex: 1;
}

.tech-sub-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tech-sub-view.active {
  display: block;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-header h2 {
  font-size: clamp(1.2rem, 4vw, 1.8rem); /* Make it responsive */
  margin: 0;
}

/* Dashboard Stats (Cards) */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-card h3 {
  margin: 0;
  font-size: 2rem;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Specific Card Colors */
.stat-pendentes { background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.3); }
.stat-pendentes h3 { color: #eab308; }

.stat-andamento { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); }
.stat-andamento h3 { color: #3b82f6; }

.stat-concluidas { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); }
.stat-concluidas h3 { color: #22c55e; }

.stat-nao-assinadas { background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.3); }
.stat-nao-assinadas h3 { color: #a855f7; }

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-card h3 {
    font-size: 1.5rem;
  }
}

/* Barra de Filtro de O.S. */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Grid de Tickets */
.tickets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .tickets-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ticket-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  max-width: 100%;
  word-break: break-word;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.ticket-card-header h4 {
  font-size: 1.1rem;
}

.ticket-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.ticket-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.8rem;
}

/* Detalhamento O.S. (TI) */
.tech-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.tech-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1.2rem;
}

.tech-item-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

@media (min-width: 500px) {
  .tech-item-header {
    flex-direction: row;
    align-items: center;
  }
}

.tech-item-header p {
  font-weight: 600;
  font-size: 1rem;
}

.tech-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.1);
  padding: 1rem;
  border-radius: 8px;
}

.tech-item-actions .actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tech-item-actions select {
  max-width: 200px;
}

.tech-item-actions textarea {
  resize: vertical;
  min-height: 60px;
}

/* Tabela de Clientes */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tech-table th,
.tech-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
}

.tech-table th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: left;
}

.tech-table tbody tr {
  transition: var(--transition);
}

.tech-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.tech-table td strong {
  color: var(--primary);
  font-family: monospace;
  font-size: 1rem;
}

.tech-table .actions-cell {
  display: flex;
  gap: 0.5rem;
}

/* Responsividade da Tabela no Mobile */
@media (max-width: 767px) {
  .tech-table, 
  .tech-table thead, 
  .tech-table tbody, 
  .tech-table tr, 
  .tech-table td {
    display: block;
    width: 100%;
  }

  .tech-table thead {
    display: none; /* Oculta cabeçalhos em colunas no celular */
  }

  .tech-table tr {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 1.2rem;
    padding: 10px 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .tech-table td {
    padding: 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }

  /* Otimização para dados longos no celular (evita colisão de textos) */
  .tech-table td[data-label="Nome da Empresa"],
  .tech-table td[data-label="Responsável"] {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 6px;
  }

  .tech-table td[data-label="Nome da Empresa"]::before,
  .tech-table td[data-label="Responsável"]::before {
    float: none;
    margin-bottom: 2px;
  }

  .tech-table td:last-child {
    border-bottom: none;
    padding-top: 12px;
    justify-content: flex-end; /* Alinha os botões de ação à direita */
  }

  .tech-table td strong {
    font-size: 0.95rem;
  }

  /* Inserir rótulo explicativo antes do valor no celular */
  .tech-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-right: 15px;
    text-align: left;
  }
}

/* Ajustes Finos de Responsividade Mobile */
@media (max-width: 767px) {
  /* Formulários empilhados no celular */
  .form-row {
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 0;
  }
  
  .form-group {
    width: 100%;
  }

  .hide-mobile {
    display: none !important;
  }

  /* Compactar a barra lateral do técnico no celular (Drawer Retrátil) */
  .tech-sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Esconde na esquerda por padrão */
    width: 260px;
    height: 100%;
    z-index: 1001; /* Fica acima do overlay */
    background: var(--bg-secondary);
    border: none;
    border-right: 1px solid var(--border-glass);
    border-radius: 0;
    padding: 3rem 1.2rem 1.2rem 1.2rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    transition: left 0.3s ease-out;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .tech-sidebar.open {
    left: 0; /* Desliza para a tela */
  }

  .tech-sidebar .user-profile {
    display: flex !important; /* Exibe perfil no celular */
  }

  .tech-sidebar hr {
    display: block !important;
  }

  .tech-sidebar .sidebar-nav {
    flex: 1;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.8rem !important;
  }

  .tech-sidebar .sidebar-link {
    flex: none;
    flex-direction: row !important; /* Ícone do lado do texto no drawer */
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0.8rem !important;
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
    width: 100% !important;
  }

  .tech-sidebar .sidebar-link i {
    width: 18px;
    height: 18px;
    margin: 0;
  }

  /* Ajustes do cabeçalho superior e logo */
  .app-header {
    padding: 1rem 0.8rem;
    gap: 0.8rem;
  }

  .logo-container h1 {
    font-size: 1.5rem;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  /* Ajustes da Timeline no Celular (evita quebra de caixa e estouros) */
  .timeline {
    padding-left: 1.2rem;
  }

  .timeline::before {
    left: 6px;
  }

  .timeline-item {
    margin-bottom: 1.5rem;
  }

  .timeline-marker {
    left: -1.2rem;
    width: 14px;
    height: 14px;
    top: 6px;
  }

  .timeline-marker i {
    width: 8px;
    height: 8px;
  }

  .timeline-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .timeline-content {
    padding: 0.8rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Ajuste no Footer e Container contra transbordos horizontais */
  .app-container {
    overflow-x: hidden;
  }

  .app-footer p {
    word-break: break-word;
    margin: 0;
  }

  /* Botões somente ícone no mobile */
  .btn-icon-only-mobile span {
    display: none;
  }
  .btn-icon-only-mobile {
    padding: 8px !important;
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
    height: auto;
  }
  .btn-icon-only-mobile i {
    margin: 0 !important;
    width: 16px;
    height: 16px;
  }
}

/* Classes de Visibilidade Globais */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Notificações Toast Premium */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 18px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  transform: translateX(120%);
  animation: slideInToast 0.3s forwards ease-out;
  transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

.toast-card.success {
  border-left-color: var(--success);
}

.toast-card.danger {
  border-left-color: var(--danger);
}

.toast-card.info {
  border-left-color: var(--primary);
}

@keyframes slideInToast {
  to { transform: translateX(0); }
}

/* Scrollbar Customizada (Aesthetics Premium) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Rodapé */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}

.comments-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  max-height: 300px;
  overflow-y: auto;
}
.past-comment {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px 14px;
}
.past-comment-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light, #60a5fa);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.past-comment p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: pre-wrap;
}

/* Modo Leitura / Documento OS */
.report-page-container {
  background: #ffffff;
  border-radius: 8px;
  padding: 40px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: Arial, Helvetica, sans-serif;
  color: #1e293b;
}
.report-page-container p {
  margin: 4px 0;
  color: #1e293b;
}
.report-page-container strong {
  color: #0f172a;
}
.report-item-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 15px;
  background: #f8fafc;
}
.report-item-header {
  font-weight: bold;
  font-size: 1rem;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.report-item-notes {
  font-size: 0.9rem;
  color: #334155;
  white-space: pre-wrap;
}


/* Unread Messages Badge */
.unread-badge {
  background-color: var(--danger, #ef4444);
  color: #ffffff;
  animation: pulse-badge 2s infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse-badge {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Assinatura em tela cheia no Mobile */
@media (max-width: 768px) {
  #client-signature-screen.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
  }
  #client-signature-screen .signature-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0;
  }
  #client-signature-screen .canvas-wrapper {
    flex: 1;
    height: auto;
    min-height: 50vh;
  }
}

/* Autocomplete Dropdown Custom Style */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  z-index: 1000;
  list-style: none;
  padding: 0;
  margin: 0;
  backdrop-filter: blur(10px);
}
.autocomplete-list li {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-main, #e2e8f0);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.autocomplete-list li:last-child {
  border-bottom: none;
}
.autocomplete-list li:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding-left: 18px;
}
.autocomplete-list li strong {
  color: #93c5fd;
}



/* Remove search cancel button */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.ticket-card.card-pendente {
  border: 1px solid rgba(234, 179, 8, 0.4);
  background-color: rgba(234, 179, 8, 0.1) !important;
}
.ticket-card.card-andamento {
  border: 1px solid rgba(59, 130, 246, 0.4);
  background-color: rgba(59, 130, 246, 0.1) !important;
}
.ticket-card.card-concluido {
  border: 1px solid rgba(34, 197, 94, 0.4);
  background-color: rgba(34, 197, 94, 0.1) !important;
}
.ticket-card.card-nao-assinada {
  border: 1px solid rgba(168, 85, 247, 0.4);
  background-color: rgba(168, 85, 247, 0.1) !important;
}

.badge.status-nao-assinado {
  background-color: rgba(168,85,247,0.15);
  color: #a855f7;
  border: 1px solid rgba(168,85,247,0.3);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hide {
  display: none;
}
.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  border-radius: 12px;
}
.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Mobile UI Optimizations */
@media (max-width: 768px) {
  .hide-text-mobile, .badge-text {
    display: none;
  }
  .badge {
    padding: 6px !important;
    width: 32px;
    height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .badge .lucide {
    margin-right: 0 !important;
  }
  #client-actions {
    display: flex !important;
    gap: 0.5rem !important;
  }
  #client-actions button,
  .client-header-actions button, .btn-back {
    padding: 0 12px !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
  }
  .client-header-actions button .lucide, .btn-back .lucide {
    margin-right: 0 !important;
  }
}

.badge { white-space: nowrap !important; }


.section-header h2 { font-size: clamp(1.1rem, 5vw, 1.5rem); margin: 0; line-height: 1.2; }



/* Responsive Table for Client Reports */
@media (max-width: 768px) {
  #report-clients-tbody, #report-clients-tbody tr, #report-clients-tbody td {
    display: block;
    width: 100%;
  }
  #report-clients-tbody tr {
    margin-bottom: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
  }
  #report-clients-tbody td {
    text-align: right !important;
    padding: 0.5rem 0 !important;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #report-clients-tbody td:last-child {
    border-bottom: none;
  }
  #report-clients-tbody td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-muted);
  }
  .card-glass table thead {
    display: none;
  }
}

#mobile-menu-active-subview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; display: inline-block; vertical-align: middle; }



/* Ajustes Visuais - Pagina Configurações */
#tech-settings label {
  text-transform: none;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: normal;
}
#tech-settings .section-header h2 {
  font-size: clamp(1.1rem, 4vw, 1.3rem) !important;
  font-weight: 600 !important;
}
#tech-settings h3 {
  font-size: 1.05rem !important;
  font-weight: 500 !important;
}


/* Ajustes de formulário para mobile */
@media (max-width: 768px) {
  .app-content {
    padding: 1.5rem 1.2rem;
  }
  .form-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.2rem !important;
    margin: 0 auto 1rem auto !important;
    box-sizing: border-box !important;
  }
}

/* Ajuste de colunas no portal do cliente */
@media (min-width: 1024px) {
  #client-portal-tickets-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
   SIDEBAR COLLAPSED STATE (DESKTOP)
   ========================================== */
@media (min-width: 1024px) {
  .tech-dashboard-layout {
    transition: grid-template-columns 0.3s ease;
  }
  
  .tech-dashboard-layout.collapsed {
    grid-template-columns: 80px 1fr;
  }
  
  .tech-dashboard-layout.collapsed .tech-sidebar .user-profile h4,
  .tech-dashboard-layout.collapsed .tech-sidebar .user-profile span,
  .tech-dashboard-layout.collapsed .tech-sidebar .nav-text,
  .tech-dashboard-layout.collapsed .tech-sidebar .btn-logout span {
    display: none !important;
  }

  .tech-dashboard-layout.collapsed .tech-sidebar .user-profile {
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
  }

  .tech-dashboard-layout.collapsed .tech-sidebar .avatar {
    margin: 0;
  }
  
  .tech-dashboard-layout.collapsed .tech-sidebar .sidebar-link,
  .tech-dashboard-layout.collapsed .tech-sidebar .btn-logout {
    justify-content: center !important;
    padding: 1rem;
  }
  
  .tech-dashboard-layout.collapsed .tech-sidebar .sidebar-link i,
  .tech-dashboard-layout.collapsed .tech-sidebar .btn-logout i {
    margin: 0 !important;
  }

  .tech-dashboard-layout.collapsed .tech-sidebar .btn-collapse-sidebar i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
  }
  

  /* Ajustes finos para os ícones no menu recolhido */
  .tech-dashboard-layout.collapsed .tech-sidebar .sidebar-link {
    padding: 0.8rem !important;
    border-radius: 8px;
    margin: 0 auto;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .tech-dashboard-layout.collapsed .tech-sidebar .sidebar-link i {
    width: 22px !important;
    height: 22px !important;
  }
  
  .tech-dashboard-layout.collapsed .tech-sidebar hr {
    width: 40px;
    margin: 0.5rem auto;
  }

  .tech-dashboard-layout.collapsed .tickets-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.btn-collapse-sidebar i {
  transition: transform 0.3s ease;
}

