/* ============================================
   Services Desk - Design System
   Visual competitivo (Trello / Monday)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Cores principais - Azul (DataServices) */
  --sd-primary: #1d4ed8;
  --sd-primary-hover: #1e40af;
  --sd-primary-light: #dbeafe;
  --sd-accent: #2563eb;
  --sd-header: #0f172a;
  --sd-header-text: #f1f5f9;
  --sd-header-text-muted: #94a3b8;
  /* Neutros */
  --sd-bg: #f1f5f9;
  --sd-bg-card: #ffffff;
  --sd-border: #e2e8f0;
  --sd-text: #0f172a;
  --sd-text-muted: #64748b;
  /* Status */
  --sd-success: #059669;
  --sd-success-bg: #d1fae5;
  --sd-error: #dc2626;
  --sd-error-bg: #fee2e2;
  --sd-warning: #d97706;
  --sd-warning-bg: #fef3c7;
  /* Superfícies - mais profundidade */
  --sd-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --sd-shadow: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --sd-shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
  --sd-radius: 12px;
  --sd-radius-sm: 8px;
  --sd-radius-btn: 8px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  margin: 0;
  background: var(--sd-bg);
  color: var(--sd-text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== Header (estilo produto) ========== */
.app-header {
  background: linear-gradient(180deg, #0f172a 0%, #0c1222 100%);
  color: var(--sd-header-text);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.app-header .brand img {
  max-height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
.app-header .nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.app-header a {
  color: var(--sd-header-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: var(--sd-radius-sm);
  transition: color 0.15s, background 0.15s;
}
.app-header a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.app-header .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.app-header .user {
  font-size: 0.875rem;
  color: var(--sd-header-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-header .user a {
  padding: 0.4rem 0.7rem;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.app-header .user a:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.app-header .user a[href="alterar_senha.php"] {
  background: transparent;
}
.app-header .user a[href="alterar_senha.php"]:hover {
  background: rgba(255,255,255,0.1);
}

/* ========== Container e página ========== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sd-text);
  letter-spacing: -0.03em;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--sd-primary) 0%, transparent 100%) 1;
}
.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--sd-text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sd-border);
}
.breadcrumb a {
  color: var(--sd-accent);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--sd-primary);
}

/* ========== Botões ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--sd-radius-btn);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #2563eb 0%, var(--sd-primary) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #3b82f6 0%, var(--sd-primary-hover) 100%);
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.38);
}
.btn-secondary {
  background: var(--sd-bg-card);
  color: var(--sd-text);
  border: 1px solid var(--sd-border);
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--sd-shadow-sm);
}
.btn-danger {
  background: var(--sd-error);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

/* ========== Cards ========== */
.card {
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  border: 1px solid var(--sd-border);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.card-body { padding: 1.35rem 1.5rem; }
.card-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sd-text);
  letter-spacing: -0.02em;
}

/* ========== Tabelas ========== */
.tabela-chamados {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  overflow: hidden;
  box-shadow: var(--sd-shadow);
  border: 1px solid var(--sd-border);
}
.tabela-chamados th,
.tabela-chamados td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--sd-border);
}
.tabela-chamados th {
  background: #f8fafc;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sd-text-muted);
}
.tabela-chamados tbody tr {
  transition: background 0.15s;
}
.tabela-chamados tbody tr:hover {
  background: #f8fafc;
}
.tabela-chamados tbody tr:last-child td { border-bottom: none; }
.tabela-chamados td:first-child a,
.tabela-chamados a[href*="chamado.php"] {
  color: var(--sd-primary);
  text-decoration: none;
  font-weight: 600;
}
.tabela-chamados a:hover { text-decoration: underline; }
/* Coluna Título: uma linha com reticências */
.tabela-chamados .col-titulo {
  width: 240px;
  max-width: 240px;
  min-width: 0;
  overflow: hidden;
}
.tabela-chamados .col-titulo .titulo-texto {
  display: block;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100%;
  min-width: 0;
}
.tabela-chamados .acoes-chamado { white-space: nowrap; vertical-align: middle; }
  .tabela-chamados .acoes-chamado .btn { margin-right: 0.35rem; margin-bottom: 0.25rem; }
.text-muted {
  color: var(--sd-text-muted);
  font-size: 0.9rem;
}

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ========== Formulários ========== */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sd-text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 3px var(--sd-primary-light);
}
.form-group textarea {
  min-height: 90px;
  resize: vertical;
}
.form-group small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--sd-text-muted);
}

.select-empresa {
  padding: 0.5rem 0.85rem;
  border-radius: var(--sd-radius-sm);
  border: 1px solid var(--sd-border);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--sd-bg-card);
}

/* ========== Alertas ========== */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--sd-radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success {
  background: var(--sd-success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.alert-error,
.alert-danger {
  background: var(--sd-error-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert-warning {
  background: var(--sd-warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

.empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--sd-text-muted);
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  border: 1px dashed var(--sd-border);
  font-size: 0.95rem;
  line-height: 1.6;
}
.empty::before {
  content: '📋';
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
/* Quando fechado, não bloquear cliques na página */
.modal-overlay[style*="display: none"],
.modal-overlay[style*="display:none"] {
  visibility: hidden;
  pointer-events: none;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--sd-bg-card);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15), 0 8px 16px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--sd-border);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sd-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sd-text);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--sd-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: #fafafa;
}

/* ========== Kanban ========== */
.kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 70vh;
  scrollbar-width: thin;
}
.kanban-col {
  flex: 0 0 300px;
  background: #f8fafc;
  border-radius: var(--sd-radius);
  padding: 1rem;
  min-height: 200px;
  border: 1px solid var(--sd-border);
  transition: background 0.2s;
}
.kanban-col h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sd-text-muted);
  letter-spacing: 0.02em;
}
.kanban-card {
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius-sm);
  padding: 0.9rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--sd-shadow-sm);
  cursor: grab;
  border-left: 4px solid var(--sd-primary);
  transition: box-shadow 0.2s, transform 0.1s;
}
.kanban-card:hover {
  box-shadow: var(--sd-shadow);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.75; }
.kanban-card .numero { font-weight: 600; font-size: 0.8rem; color: var(--sd-primary); }
.kanban-card .titulo { font-size: 0.875rem; margin: 0.35rem 0; font-weight: 500; }
.kanban-card .meta { font-size: 0.75rem; color: var(--sd-text-muted); }
.kanban-card .badge { margin-top: 0.35rem; }
.kanban-card .datas { font-size: 0.7rem; color: #94a3b8; margin-top: 0.35rem; }
.kanban-col.drag-over { background: #e2e8f0; }
/* Cartões cancelados: texto riscado */
.kanban-card--cancelado .numero,
.kanban-card--cancelado .titulo,
.kanban-card--cancelado .meta,
.kanban-card--cancelado .datas { text-decoration: line-through; color: #94a3b8; }

/* ========== Utilitários ========== */
.filtros-dashboard label { margin-right: 0.35rem; font-size: 0.9rem; color: var(--sd-text-muted); }
.filtros-dashboard input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-sm);
  font-size: 0.9rem;
  margin-right: 0.5rem;
}
/* Dashboard: cards de estatísticas */
.dashboard-grid .card {
  border-left: 4px solid var(--sd-primary);
}
.dashboard-grid .card h3 {
  color: var(--sd-text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dashboard-grid .card ul li {
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}

/* ========== Layout dual (form + lista) - estilo Trello/Jira ========== */
.page-layout-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.page-layout-dual .card {
  min-width: 0;
  overflow: visible;
}
.page-layout-dual .card-body { overflow: visible; }
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem 0 0;
  min-width: 0;
}
.table-wrapper .tabela-chamados { margin-bottom: 0; }
.form-section { min-width: 0; }

/* ========== Rodapé ========== */
.app-footer {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sd-border);
  background: #f8fafc;
  text-align: center;
  font-size: 0.85rem;
  color: var(--sd-text-muted);
}
.app-footer p { margin: 0; }
.app-footer a {
  color: var(--sd-primary);
  text-decoration: none;
  font-weight: 500;
}
.app-footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .page-layout-dual {
    grid-template-columns: 1fr;
  }
}

/* ========== Responsivo (tablet e celular) ========== */
@media (max-width: 768px) {
  .app-header { height: auto; min-height: 56px; padding: 0.75rem 1rem; gap: 0.5rem; }
  .app-header .nav-links { flex-wrap: wrap; gap: 0.25rem; }
  .app-header a { padding: 0.6rem 0.75rem; min-height: 44px; display: inline-flex; align-items: center; }
  .app-header .user { flex-wrap: wrap; font-size: 0.8rem; }
  .app-header .user a { min-height: 36px; padding: 0.5rem 0.65rem; }
  .container { padding: 1rem; max-width: 100%; }
  .page-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .page-header h1 { font-size: 1.35rem; }
  .page-actions .btn { min-height: 44px; padding: 0.65rem 1rem; }
  .tabela-chamados th:nth-child(n+4),
  .tabela-chamados td:nth-child(n+4) { display: none; }
  .tabela-chamados th.th-acoes,
  .tabela-chamados td.acoes-chamado { display: table-cell !important; }
  .tabela-chamados .acoes-chamado .btn { display: inline-block; min-width: 4rem; }
  .page-layout-dual .table-wrapper { margin: 0; }
  .btn { min-height: 42px; padding: 0.6rem 1rem; }
  .form-group input, .form-group select, .form-group textarea { min-height: 44px; font-size: 16px; }
  .modal { max-width: 96%; margin: 1rem; max-height: 85vh; }
}

/* Kanban: scroll horizontal suave no celular */
@media (max-width: 768px) {
  .kanban { padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
  .kanban-col { flex: 0 0 260px; min-height: 180px; }
  .kanban-card { padding: 0.75rem; }
}

/* SLA no card e listagem */
.kanban-card-sla.sla-atrasado { color: var(--sd-danger, #dc2626) !important; font-weight: 600; }
.sla-atrasado { color: var(--sd-danger, #dc2626); }

/* ========== Portal do Cliente (visual profissional) ========== */
.body-portal {
  font-family: var(--font-sans);
  background: #f1f5f9 linear-gradient(165deg, #f0f9ff 0%, #e0f2fe 35%, #f1f5f9 70%) no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header estilo produto */
.portal-header {
  background: linear-gradient(180deg, #0f172a 0%, #0c1222 100%);
  color: #f1f5f9;
  padding: 0 1.5rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.portal-header-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.portal-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.portal-brand-icon::before {
  content: '';
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.portal-brand-text { display: flex; flex-direction: column; gap: 0.1rem; }
.portal-brand-name { font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1.3; }
.portal-brand-tagline { font-size: 0.8rem; color: #94a3b8; font-weight: 500; }
.portal-user { flex-shrink: 0; }
.portal-user-email {
  display: inline-block;
  font-size: 0.875rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Conteúdo principal */
.portal-main { flex: 1; padding: 2rem 1.25rem 2.5rem; }
.portal-content { max-width: 680px; margin: 0 auto; width: 100%; min-width: 0; }
.portal-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--sd-text);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.portal-page-subtitle {
  font-size: 1rem;
  color: var(--sd-text-muted);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

/* Cards */
.portal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sd-shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--sd-border);
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.portal-card .portal-card-header {
  padding: 1.15rem 1.5rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.portal-card .portal-card-body { padding: 1.5rem; }
.portal-chamados-list { display: flex; flex-direction: column; gap: 1rem; }
.portal-chamado-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #2563eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.portal-chamado-item:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1), 0 2px 4px rgba(15, 23, 42, 0.06);
  border-left-color: #1d4ed8;
}
.portal-chamado-item .portal-chamado-titulo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.portal-chamado-titulo-icon {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  display: inline-block;
}
.portal-chamado-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-size: 0.875rem;
}
.portal-chamado-item .portal-chamado-numero {
  font-weight: 700;
  color: var(--sd-primary);
  font-size: 0.9rem;
}
.portal-chamado-item .portal-chamado-meta { font-size: 0.85rem; color: var(--sd-text-muted); }
.portal-status {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.portal-status-backlog { background: #e2e8f0; color: #475569; }
.portal-status-andamento { background: #fef3c7; color: #b45309; }
.portal-status-finalizado { background: #d1fae5; color: #047857; }
.portal-status-cancelado { background: #fee2e2; color: #b91c1c; }

/* Formulário novo chamado */
.portal-form-novo {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sd-shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--sd-border);
  overflow: hidden;
}
/* Formulário recolhível: ao clicar no cabeçalho abre/fecha */
.portal-form-novo--collapsed .portal-form-body { display: none; }
.portal-form-novo .portal-form-header {
  padding: 1.15rem 1.5rem;
  background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}
.portal-form-header-btn {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  margin: 0;
  transition: background 0.2s, opacity 0.2s;
}
.portal-form-header-btn:hover { background: rgba(255, 255, 255, 0.1); }
.portal-form-header-btn:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
.portal-form-header-btn .portal-form-header-chevron { margin-left: auto; flex-shrink: 0; }
.portal-form-novo:not(.portal-form-novo--collapsed) .portal-form-header-chevron { transform: rotate(180deg); }
.portal-form-header-chevron::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  display: block;
  transition: transform 0.2s;
}
.portal-form-header-icon::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  display: inline-block;
  vertical-align: middle;
}
.portal-form-novo .portal-form-body { padding: 1.5rem; }
.portal-form { max-width: 100%; min-width: 0; }
.portal-form-group { margin-bottom: 1.35rem; }
.portal-form-group .portal-input { box-sizing: border-box; min-width: 0; }
.portal-form-group:last-of-type { margin-bottom: 1.5rem; }
.portal-label {
  display: block;
  font-weight: 600;
  color: var(--sd-text);
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}
.portal-required { color: var(--sd-danger, #dc2626); }
.portal-input {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 1rem;
  color: var(--sd-text);
  background: #fff;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.portal-input:focus {
  outline: none;
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.portal-input::placeholder { color: var(--sd-text-muted); opacity: 0.85; }
.portal-textarea { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.55; }
.portal-btn-submit {
  padding: 0.85rem 1.85rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.portal-btn-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3); }
.portal-btn-icon::before {
  content: '';
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  display: inline-block;
  vertical-align: middle;
}

.portal-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--sd-text-muted);
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed var(--sd-border);
  font-size: 0.95rem;
}
.portal-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.75; }

/* Avisos */
.portal-avisos-banner { margin-bottom: 1.5rem; }
.portal-avisos-banner .alert { border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: var(--sd-shadow); }

/* Rodapé portal */
.portal-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.03);
  border-top: 1px solid var(--sd-border);
  font-size: 0.9rem;
  color: var(--sd-text-muted);
}
.portal-footer p { margin: 0; }
.portal-footer a { color: var(--sd-primary); font-weight: 500; text-decoration: none; }
.portal-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .portal-header-inner { padding: 0.75rem 0; }
  .portal-user-email { max-width: 160px; font-size: 0.8rem; }
  .portal-page-title { font-size: 1.5rem; }
  .portal-main { padding: 1.5rem 1rem 2rem; }
  .portal-chamado-item { padding: 1rem 1.25rem; }
  .portal-chamado-meta-line { flex-direction: column; align-items: flex-start; }
}
