/* ==========================================================================
   HELP DESK — Design System
   Paleta "Tech Navy & Signal Teal": pensada para uma assistência técnica
   informática — navy profundo (confiança/infraestrutura), teal/cyan de
   "sinal ligado" para ações e estados ativos, e uma escala de estado
   (aberto/progresso/resolvido/fechado) usada em toda a plataforma.
   Não contém qualquer alteração de lógica — apenas estilos.
   ========================================================================== */

:root {
  /* ---- Marca / Tech Navy & Signal Teal ---- */
  --brand-900: #071B2B;
  --brand-800: #0A2436;
  --brand-700: #0E7490;
  --brand-600: #0891B2;
  --brand-500: #06B6D4;
  --brand-400: #22D3EE;
  --brand-100: #E3F7FA;
  --brand-050: #F0FBFD;

  /* Compat (nomes antigos usados em código legado) */
  --brand-primary: var(--brand-700);
  --brand-dark: var(--brand-900);
  --brand-secondary: var(--brand-600);
  --brand-light: var(--brand-100);
  --brand-accent: #F59E0B;

  /* ---- Neutros / superfícies ---- */
  --ink: #101A2B;
  --ink-soft: #33415A;
  --muted: #64748B;
  --muted-soft: #94A3B8;
  --surface: #FFFFFF;
  --surface-alt: #F3F6FB;
  --surface-sunken: #EBEFF7;
  --border-soft: #E4E9F3;
  --border-strong: #D6DEEC;

  /* ---- Estados de ticket ---- */
  --status-open: #E11D48;
  --status-open-bg: #FEE9EE;
  --status-progress: #D97706;
  --status-progress-bg: #FEF3DB;
  --status-resolved: #0D9488;
  --status-resolved-bg: #DCFAF3;
  --status-closed: #64748B;
  --status-closed-bg: #EEF1F6;
  --status-analise: #6D28D9;
  --status-analise-bg: #EFE7FC;

  /* ---- Tipografia ---- */
  --font-display: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Layout ---- */
  --sidebar-width: 260px;
  --topbar-height: 68px;

  /* ---- Elevação / raio ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(10, 22, 40, .05);
  --shadow-sm: 0 2px 8px rgba(10, 22, 40, .06);
  --shadow-md: 0 10px 26px rgba(10, 22, 40, .09);
  --shadow-lg: 0 24px 56px rgba(7, 27, 43, .18);
}

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--surface-alt);
  font-family: var(--font-body);
  color: var(--ink);
  font-size: .95rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -.01em;
}

a { color: var(--brand-700); }
a:hover { color: var(--brand-900); }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ================= App Shell (sidebar + topbar) ================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(190deg, var(--brand-900) 0%, var(--brand-800) 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1045;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-decoration: none;
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(6, 182, 212, .35);
}
.sidebar-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: #fff;
  line-height: 1.15;
}
.sidebar-brand-text::after {
  content: 'Assistência Informática';
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .66rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--brand-400);
  margin-top: 2px;
}
.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}
.sidebar-nav { padding: 18px 14px 24px; flex: 1; }
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
  padding: 16px 12px 8px;
}
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu li { margin-bottom: 3px; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.sidebar-menu a i { font-size: 1.05rem; width: 20px; text-align: center; color: rgba(255, 255, 255, .4); transition: color .15s ease; }
.sidebar-menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-menu a:hover i { color: var(--brand-400); }
.sidebar-menu a.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, .18), rgba(6, 182, 212, .04));
  color: #fff;
  font-weight: 600;
}
.sidebar-menu a.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-400);
  box-shadow: 0 0 10px var(--brand-400);
}
.sidebar-menu a.active i { color: var(--brand-400); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 15, 26, .55);
  backdrop-filter: blur(2px);
  z-index: 1040;
}
.sidebar-backdrop.show { display: block; }

/* ---- Topbar ---- */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-height);
  padding: 12px 28px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 1020;
}
.sidebar-toggle {
  border: none;
  background: var(--surface-sunken);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.2rem;
  margin-right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.sidebar-toggle:hover { background: var(--brand-100); color: var(--brand-700); }
.topbar-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-bell {
  position: relative;
  font-size: 1.15rem;
  color: var(--muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  transition: background .15s ease, color .15s ease;
}
.topbar-bell:hover { background: var(--brand-100); color: var(--brand-700); }
.topbar-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--status-open); color: #fff; border-radius: 999px;
  font-size: .6rem; line-height: 1; padding: 3px 5px; font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink);
  padding: 5px 10px 5px 5px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  transition: box-shadow .15s ease;
}
.topbar-user:hover { box-shadow: var(--shadow-sm); color: var(--ink); }
.topbar-user::after { filter: none; }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  font-family: var(--font-display);
}
.topbar-username { font-size: .87rem; font-weight: 600; }

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: inline-flex; }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 10px 16px; }
  .topbar-title { font-size: 1rem; }
}

/* ---- Layout ---- */
.app-content {
  min-height: calc(100vh - var(--topbar-height) - 52px);
  padding: 26px 28px 44px;
}
@media (max-width: 576px) {
  .app-content { padding: 16px 14px 32px; }
}
.app-footer {
  background: transparent;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-soft);
}

/* ==========================================================================
   Autenticação — layout dividido (marca + formulário) com fundo tecnológico
   ========================================================================== */
body.auth-body {
  min-height: 100vh;
  background: var(--brand-900);
}
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-brand-panel {
  position: relative;
  flex: 0 0 44%;
  max-width: 560px;
  background: radial-gradient(circle at 20% 10%, #0E3550 0%, var(--brand-900) 55%, #050F19 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 46px;
  overflow: hidden;
}
.auth-brand-panel .circuit-bg {
  position: absolute;
  inset: 0;
  opacity: .55;
  pointer-events: none;
}
.auth-brand-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.auth-brand-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; box-shadow: 0 8px 22px rgba(6, 182, 212, .4);
}
.auth-brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.auth-brand-name span { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-400); margin-top: 3px; }

.auth-brand-mid { position: relative; z-index: 2; margin-top: 40px; }
.auth-brand-mid h2 {
  color: #fff; font-size: 1.7rem; font-weight: 800; line-height: 1.25; max-width: 380px;
}
.auth-brand-mid p { color: rgba(255, 255, 255, .68); font-size: .93rem; max-width: 360px; margin-top: 10px; }

.auth-brand-stats { position: relative; z-index: 2; display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.auth-brand-stats div { min-width: 90px; }
.auth-brand-stats strong { display: block; font-family: var(--font-mono); font-size: 1.35rem; color: var(--brand-400); }
.auth-brand-stats span { font-size: .72rem; color: rgba(255, 255, 255, .55); text-transform: uppercase; letter-spacing: .04em; }

.auth-brand-foot { position: relative; z-index: 2; font-size: .74rem; color: rgba(255, 255, 255, .38); }

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  padding: 40px 24px;
}
.auth-form-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 38px 34px;
  border: 1px solid var(--border-soft);
}
.auth-form-card h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.auth-form-card .auth-subtitle { color: var(--muted); font-size: .87rem; margin-bottom: 22px; }

.input-icon-group { position: relative; }
.input-icon-group > i,
.input-icon-group > .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-soft);
  font-size: .95rem;
  pointer-events: none;
}
.input-icon-group .form-control { padding-left: 40px; }
.input-icon-group .toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted-soft);
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.input-icon-group .toggle-password:hover { background: var(--surface-sunken); color: var(--ink); }

.auth-form-card .form-control,
.auth-form-card .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  padding-top: .62rem;
  padding-bottom: .62rem;
  font-size: .92rem;
}
.auth-form-card .form-control:focus,
.auth-form-card .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.auth-form-card .btn-primary {
  padding: .68rem 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: .01em;
}
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: .84rem; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--brand-700); text-decoration: underline; }

@media (max-width: 991.98px) {
  .auth-shell { flex-direction: column; }
  .auth-brand-panel { flex: none; max-width: none; padding: 26px 26px 34px; }
  .auth-brand-mid { margin-top: 18px; }
  .auth-brand-mid h2 { font-size: 1.25rem; }
  .auth-brand-stats { margin-top: 18px; gap: 16px; }
  .auth-form-panel { padding: 28px 18px 44px; }
  .auth-form-card { padding: 28px 22px; box-shadow: none; border: none; }
}

/* Fallback simples (ex.: setup_admin.php) usando classes antigas */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 15%, #0E3550, var(--brand-900) 60%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 420px;
  width: 100%;
}
.auth-card .card-header {
  background: var(--brand-900);
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  border: none;
}

/* ---- Cards / Dashboard ---- */
.stat-card {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  border: 1px solid var(--border-soft);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}
.stat-card.bg-total .stat-icon    { background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); }
.stat-card.bg-open .stat-icon     { background: linear-gradient(135deg, #f43f5e, var(--status-open)); }
.stat-card.bg-progress .stat-icon { background: linear-gradient(135deg, #fbbf24, var(--status-progress)); }
.stat-card.bg-resolved .stat-icon { background: linear-gradient(135deg, var(--brand-500), var(--status-resolved)); }
.stat-card.bg-closed .stat-icon   { background: linear-gradient(135deg, #94a3b8, var(--status-closed)); }

.stat-card:not(:has(.stat-icon)) { display: block; }

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: #fff !important;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-display);
  padding: 14px 18px;
}
.card-header:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}
.card-body { padding: 18px; }

.card.p-3.text-center {
  border-radius: var(--radius-lg);
}

/* ---- Botões ---- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem; }
.btn-sm { border-radius: 8px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  border-color: var(--brand-900);
}
.btn-outline-primary {
  color: var(--brand-700);
  border-color: var(--brand-700);
}
.btn-outline-primary:hover {
  background-color: var(--brand-700);
  border-color: var(--brand-700);
}
.btn-outline-secondary { color: var(--ink-soft); border-color: var(--border-strong); }
.btn-outline-secondary:hover { background: var(--surface-sunken); color: var(--ink); border-color: var(--border-strong); }

/* ---- Formulários ---- */
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  font-size: .9rem;
  padding: .55rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
textarea.form-control { border-radius: var(--radius-md); }

/* Ícone de pesquisa embutido nos campos "q" das listagens, sem alterar o HTML */
input[name="q"] {
  padding-left: 2.35rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* ---- Badges de estado (pill + ponto) ---- */
.badge { font-weight: 600; font-size: .72rem; letter-spacing: .01em; border-radius: var(--radius-pill); padding: .42em .75em; }

.badge.bg-danger   { background-color: var(--status-open-bg) !important; color: var(--status-open) !important; }
.badge.bg-warning  { background-color: var(--status-progress-bg) !important; color: var(--status-progress) !important; }
.badge.bg-success  { background-color: var(--status-resolved-bg) !important; color: var(--status-resolved) !important; }
.badge.bg-secondary{ background-color: var(--status-closed-bg) !important; color: var(--status-closed) !important; }
.badge.bg-info     { background-color: var(--brand-100) !important; color: var(--brand-700) !important; }
.badge.bg-primary  { background-color: var(--brand-100) !important; color: var(--brand-900) !important; }
.badge.bg-dark     { background-color: #FDF1DC !important; color: #92621A !important; }
.badge.bg-light    { background-color: var(--surface-sunken) !important; }

.badge.bg-danger::before,
.badge.bg-warning::before,
.badge.bg-success::before,
.badge.bg-secondary::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: middle;
}

/* ---- Tabelas ---- */
.table { font-size: .88rem; margin-bottom: 0; }
.table thead th {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 16px;
  white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: var(--border-soft); color: var(--ink-soft); }
.table tbody tr:hover { background: var(--brand-050); }

/* Empilhamento responsivo (JS adiciona data-label a partir do cabeçalho) */
@media (max-width: 767.98px) {
  .table-responsive table thead { display: none; }
  .table-responsive table,
  .table-responsive tbody,
  .table-responsive tr,
  .table-responsive td { display: block; width: 100%; }
  .table-responsive tr {
    margin: 0 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
  }
  .table-responsive tr:last-child { margin-bottom: 0; }
  .table-responsive td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: right;
    padding: 8px 2px;
    border: 0;
    border-bottom: 1px dashed var(--border-soft);
  }
  .table-responsive td:last-child { border-bottom: 0; }
  .table-responsive td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted-soft);
    text-align: left;
    flex-shrink: 0;
  }
  .table-responsive td:not([data-label]) { display: block; text-align: center; }
  .table-responsive tbody tr:hover { background: var(--surface); }
}

/* ---- Conversa / thread do ticket (estilo mensagens) ---- */
.chat-thread { display: flex; flex-direction: column; gap: 4px; }
.msg-bubble {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  max-width: 82%;
  box-shadow: var(--shadow-xs);
  position: relative;
}
.msg-bubble strong { font-size: .84rem; font-weight: 700; }
.msg-bubble .badge { font-size: .6rem; padding: .3em .55em; }
.msg-bubble small { font-size: .72rem; }
.msg-bubble p { font-size: .89rem; line-height: 1.5; }

.chat-thread .msg-client {
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
  margin-right: auto;
}
.chat-thread .msg-tech {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.chat-thread .msg-tech strong,
.chat-thread .msg-tech small,
.chat-thread .msg-tech .text-muted { color: rgba(255, 255, 255, .78) !important; }
.chat-thread .msg-tech .badge.bg-secondary { background-color: rgba(255, 255, 255, .18) !important; color: #fff !important; }
.chat-thread .msg-tech a.attachment-file-link { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }

.chat-thread .msg-internal {
  background: #FFFBEB;
  border: 1px dashed #F2C14E;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.chat-thread .msg-internal .badge.bg-dark { background-color: #F2C14E !important; color: #4A2E00 !important; }

.msg-client { background: var(--brand-light); border-left: 4px solid var(--brand-primary); }
.msg-tech { background: #fff7ed; border-left: 4px solid var(--brand-accent); }
.msg-internal { background: #f1f5f9; border-left: 4px dashed #64748b; }

@media (max-width: 576px) {
  .msg-bubble { max-width: 100%; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .stat-card { padding: 16px; }
}

.card-body form textarea[name="message"] { min-height: 90px; border-radius: var(--radius-md); }

/* ---- Anexos ---- */
.attachments-block { width: 100%; }

.attachment-thumb-link {
  display: inline-block;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  line-height: 0;
  cursor: zoom-in;
  transition: transform .15s ease, box-shadow .15s ease;
}
.attachment-thumb-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.attachment-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
  background: var(--surface-sunken);
}

.attachment-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--brand-700);
  text-decoration: none;
  font-size: .85rem;
  max-width: 220px;
}
.attachment-file-link:hover { background: var(--brand-100); }
.attachment-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#attachmentPreviewImg { max-height: 70vh; }

/* ---- Listas / perfis ---- */
.list-group-item { border-color: var(--border-soft); padding: .7rem 1rem; font-size: .88rem; }

/* ---- Modais ---- */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border-soft); font-family: var(--font-display); }
.modal-footer { border-top: 1px solid var(--border-soft); }

/* ---- Alertas ---- */
.alert { border-radius: var(--radius-md); border: 1px solid transparent; font-size: .89rem; }
.alert-success { background: var(--status-resolved-bg); color: #0b5c53; border-color: #b7ede2; }
.alert-danger { background: var(--status-open-bg); color: #9c1030; border-color: #f8c7d3; }
.alert-warning { background: var(--status-progress-bg); color: #7a4b06; border-color: #f4dba3; }

/* ---- Página / títulos ---- */
.container-fluid > h3, .container-fluid > h4 { font-family: var(--font-display); font-weight: 800; }


.auth-form-card{
    max-width:420px;
    width:100%;
    padding:40px;
    border-radius:20px;
    background:#fff;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.logo{
    text-align:center;
    margin-bottom:20px;
}

.logo img{
    width:180px;
    max-width:100%;
}

.auth-form-card h1{
    text-align:center;
    font-size:28px;
    font-weight:700;
    margin-bottom:8px;
}

.subtitle{
    text-align:center;
    color:#6b7280;
    margin-bottom:30px;
}

.input-group-custom{
    position:relative;
    margin-bottom:18px;
}

.input-group-custom i{
    position:absolute;
    left:15px;
    top:50%;
    transform:translateY(-50%);
    color:#9ca3af;
}

.input-group-custom input{
    width:100%;
    height:52px;
    border:1px solid #d1d5db;
    border-radius:12px;
    padding-left:45px;
    padding-right:45px;
    outline:none;
}

.input-group-custom input:focus{
    border-color:#06b6d4;
}

.toggle-password{
    position:absolute;
    right:15px;
    top:50%;
    transform:translateY(-50%);
    cursor:pointer;
    color:#9ca3af;
}

.options{
    text-align:right;
    margin-bottom:20px;
}

.options a{
    text-decoration:none;
    color:#06b6d4;
    font-size:14px;
}

.btn-login{
    width:100%;
    height:52px;
    border:none;
    border-radius:12px;
    background:#06b6d4;
    color:#fff;
    font-weight:700;
    cursor:pointer;
}

.btn-login:hover{
    background:#0891b2;
}

.signup{
    margin-top:20px;
    text-align:center;
}

.signup a{
    color:#06b6d4;
    text-decoration:none;
    font-weight:600;
}

