@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===============================================
   PALETA SINERGYRH
   Azul:    #128EFB
   Laranja: #F58634
   Teal:    #00B0BA
   Navy:    #0d1f3c
   Fundo:   #F4F6F9
   Fonte:   Poppins
   =============================================== */

:root {
  --s-blue:       #128EFB;
  --s-blue-dark:  #0a6dc9;
  --s-orange:     #F58634;
  --s-orange-dark:#d96b1a;
  --s-teal:       #00B0BA;
  --s-navy:       #0d1f3c;
  --s-navy-mid:   #1a3358;
  --s-bg:         #F4F6F9;
  --s-text:       #2d2d2d;
  --s-muted:      #6d6d6d;
}

/* ─── BASE ─── */
html { font-size: 14px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--s-bg);
  color: var(--s-text);
  margin-bottom: 0;
}

.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(18, 142, 251, 0.3);
}

/* ─── NAVBAR ─── */
.navbar.navbar-dark {
  background: linear-gradient(135deg, var(--s-navy) 0%, var(--s-navy-mid) 100%) !important;
  border-bottom: 3px solid var(--s-blue);
  padding: 0.55rem 1.25rem;
}

.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand img.logo-nav {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1); /* torna branco sobre fundo escuro */
}

.navbar-nav .nav-link {
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.45rem 0.9rem !important;
  border-radius: 7px;
  transition: background 0.18s, color 0.18s;
  color: rgba(255,255,255,.8) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(18, 142, 251, 0.22);
  color: #fff !important;
}

.navbar-text { color: rgba(255,255,255,.75) !important; font-size: 0.85rem; }

/* ─── HEADINGS ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--s-navy);
}

/* ─── CARDS ─── */
.card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(0,0,0,.07);
}

.card-header {
  border-radius: 14px 14px 0 0 !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
}

.card-header.bg-primary,
.card-header.bg-primary.text-white {
  background-color: var(--s-blue) !important;
}

.card-header.table-dark,
.card-header.bg-dark {
  background: linear-gradient(135deg, var(--s-navy), var(--s-navy-mid)) !important;
  color: #fff;
}

.card.border-primary { border: 2px solid var(--s-blue) !important; }

/* ─── BUTTONS ─── */
.btn-primary {
  background-color: var(--s-blue);
  border-color: var(--s-blue);
  font-weight: 600;
  border-radius: 8px;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--s-blue-dark);
  border-color: var(--s-blue-dark);
}

.btn-outline-primary {
  color: var(--s-blue);
  border-color: var(--s-blue);
  font-weight: 600;
  border-radius: 8px;
}
.btn-outline-primary:hover {
  background-color: var(--s-blue);
  border-color: var(--s-blue);
}

.btn-outline-secondary {
  border-radius: 8px;
  font-weight: 500;
}

.btn-outline-light { border-radius: 8px; font-size: 0.85rem; font-weight: 600; }

/* ─── FORMULÁRIOS ─── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d8dde6;
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--s-blue);
  box-shadow: 0 0 0 0.2rem rgba(18, 142, 251, 0.18);
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a4a5a;
  margin-bottom: 0.3rem;
}
.form-control::placeholder { color: #b0b8c6; }

/* ─── TABELA ─── */
.table {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
}

.table-dark thead th,
thead.table-dark th {
  background: linear-gradient(135deg, var(--s-navy), var(--s-navy-mid)) !important;
  color: rgba(255,255,255,.85);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  padding: 0.85rem 0.75rem;
  white-space: nowrap;
}

.table thead.table-dark th:first-child { border-radius: 10px 0 0 0; }
.table thead.table-dark th:last-child  { border-radius: 0 10px 0 0; }

.table-hover tbody tr { transition: background 0.12s; }
.table-hover tbody tr:hover { background-color: rgba(18, 142, 251, 0.05) !important; }

.table tbody td {
  vertical-align: middle;
  padding: 0.65rem 0.75rem;
  border-color: #eef0f5;
}

/* ─── BADGES ─── */
.badge {
  font-weight: 500;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.3em 0.65em;
  letter-spacing: 0.2px;
}

/* Prioridade Alta usa laranja da marca */
.badge.bg-danger { background-color: var(--s-orange) !important; color: #fff !important; }
/* Prioridade Baixa usa teal */
.badge.bg-info   { background-color: var(--s-teal) !important; color: #fff !important; }

/* ─── ALERTS ─── */
.alert {
  border-radius: 10px;
  font-size: 0.875rem;
  border-width: 0;
  border-left: 4px solid;
}
.alert-success { border-left-color: #28a745; background: #f0fff4; color: #1a5c2a; }
.alert-danger  { border-left-color: #dc3545; background: #fff5f5; color: #7b1c25; }
.alert-info    { border-left-color: var(--s-blue); background: #f0f8ff; color: #0a4a8a; }

/* ─── SEMÁFORO ─── */
.semaforo {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  flex-shrink: 0;
}
.semaforo-verde     { background-color: #22c55e; }
.semaforo-amarelo   { background-color: #f59e0b; }
.semaforo-vermelho  { background-color: #ef4444; }
.semaforo-sem-prazo { background-color: #94a3b8; }

/* ─── SELECT / RADIO GROUPS ─── */
.btn-check:checked + .btn-danger  { background-color: var(--s-orange); border-color: var(--s-orange); }
.btn-check:checked + .btn-warning { background-color: #f59e0b; border-color: #f59e0b; }
.btn-check:checked + .btn-info    { background-color: var(--s-teal);   border-color: var(--s-teal); color:#fff; }

/* ─── MISC ─── */
.text-muted { color: var(--s-muted) !important; }
.fw-semibold { font-weight: 600 !important; }

a { color: var(--s-blue); }
a:hover { color: var(--s-blue-dark); }

/* Link de chamado na tabela */
.table a.text-dark:hover { color: var(--s-blue) !important; text-decoration: none; }

/* Definição list no detalhe */
dt { color: var(--s-muted); font-weight: 500; }
dd { font-weight: 400; }

/* Container principal */
.container-fluid.px-4 { padding-top: 0.5rem; }

/* ─── KANBAN ──────────────────────────────────────────────── */
.kanban-wrapper {
  display: flex;
  gap: 1rem;
  overflow: hidden;
  min-height: calc(100vh - 110px);
  align-items: flex-start;
}

.kanban-fixed {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  align-items: flex-start;
}

.kanban-scroll-area {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 2rem;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 270px;
  width: 270px;
  background: #eef2f7;
  border-radius: 10px;
  padding: 0.5rem;
}

.kanban-col-header,
.kanban-dev-header {
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--s-navy);
  padding: 0.4rem 0.25rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.kanban-list {
  min-height: 80px;
  padding: 2px 0;
}

.kanban-card {
  background: white;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  cursor: grab;
  margin-bottom: 0.4rem;
  border-left: 3px solid #ddd;
  transition: box-shadow .15s, transform .1s;
  user-select: none;
}
.kanban-card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
  transform: translateY(-1px);
}
.kanban-card.prioridade-alta  { border-left-color: var(--s-orange); }
.kanban-card.prioridade-media { border-left-color: var(--s-blue); }
.kanban-card.prioridade-baixa { border-left-color: var(--s-teal); }

.sortable-ghost { opacity: .4; background: #c8ebff; border-radius: 8px; }
.sortable-drag  { box-shadow: 0 8px 24px rgba(0,0,0,.2) !important; transform: rotate(1deg) !important; }

.ticket-id    { font-size: .68rem; color: var(--s-muted); font-weight: 500; }
.kanban-status-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 500;
  color: #5a6a82;
  background: #eef1f7;
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .2px;
}
.ticket-titulo {
  font-size: .8rem;
  font-weight: 500;
  color: var(--s-text);
  margin: 0.15rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.horas-badge     { background: #e8f4ff; color: var(--s-blue); border-radius: 4px; padding: 1px 5px; font-size: .68rem; font-weight: 600; }
.sem-horas-badge { background: #fff3e0; color: #e65100; border-radius: 4px; padding: 1px 5px; font-size: .68rem; font-weight: 500; cursor: pointer; }
.btn-estimar     { line-height: 1; }
.lancar-badge    { background: #e8f5e9; color: #2e7d32; border-radius: 4px; padding: 1px 6px; font-size: .76rem; font-weight: 700; cursor: pointer; }
.btn-lancar      { line-height: 1; }

.pos-badge      { background: var(--s-navy); color: white; border-radius: 50%; width: 18px; height: 18px; font-size: .62rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.pos-num        { background: var(--s-navy); color: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.25); letter-spacing: -.5px; }

.prazo-row        { display: flex; justify-content: space-between; font-size: .68rem; color: var(--s-muted); }
.prazo-calculado  { font-weight: 600; }
.prazo-calculado.ok      { color: var(--s-teal); }
.prazo-calculado.atencao { color: #f59f00; }
.prazo-calculado.atraso  { color: #dc3545; }
.prazo-calculado.sem-prazo { color: var(--s-muted); }

.prazo-bar  { height: 4px; background: #e9ecef; border-radius: 2px; overflow: hidden; margin-top: 0.3rem; }
.prazo-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.prazo-fill.ok       { background: var(--s-teal); }
.prazo-fill.atencao  { background: #ffc107; }
.prazo-fill.atraso   { background: #dc3545; }
.prazo-fill.sem-prazo { background: #dee2e6; }

.dif-label         { font-size: .63rem; text-align: right; margin-top: 2px; }
.dif-label.ok      { color: var(--s-teal); }
.dif-label.atencao { color: #f59f00; }
.dif-label.atraso  { color: #dc3545; }

.prazo-previsto-val { cursor: pointer; border-bottom: 1px dashed #aaa; }
.prazo-previsto-val:hover { color: var(--s-blue); }

.fila-vazia {
  text-align: center;
  padding: 1.2rem 0.5rem;
  color: var(--s-muted);
  font-size: .75rem;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── SIDEBAR LAYOUT ──────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e9f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,.06);
}

.sidebar-brand {
  background: linear-gradient(135deg, var(--s-navy) 0%, var(--s-navy-mid) 100%);
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 3px solid var(--s-blue);
}

.sidebar-logo {
  height: 28px;
  filter: brightness(0) invert(1);
}

.sidebar-brand-sub {
  font-size: .62rem;
  color: rgba(255,255,255,.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 3px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem;
}

.sidebar-group-label {
  font-size: .6rem;
  font-weight: 700;
  color: var(--s-muted);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  padding: 0.9rem 0.6rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.52rem 0.75rem;
  border-radius: 8px;
  font-size: .845rem;
  font-weight: 500;
  color: var(--s-text);
  text-decoration: none;
  transition: background .14s, color .14s;
  margin-bottom: 1px;
}

.sidebar-link:hover {
  background: rgba(18, 142, 251, 0.09);
  color: var(--s-blue);
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(18, 142, 251, 0.13);
  color: var(--s-blue);
  font-weight: 600;
}

.sidebar-icon {
  font-size: .95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid #e5e9f0;
  padding: 0.75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--s-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--s-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: .72rem;
  color: var(--s-muted);
  cursor: pointer;
  text-decoration: underline;
}

.sidebar-logout-btn:hover { color: var(--s-blue); }

.main-content {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  padding-top: 1.25rem;
}

/* Ajuste do kanban com sidebar */
.kanban-wrapper {
  min-height: calc(100vh - 2.5rem);
}
