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

/* ===========================
   VARIÁVEIS
=========================== */
:root {
  --white:       #ffffff;
  --off-white:   #f7f7f5;
  --gray-50:     #f2f2f0;
  --gray-100:    #e8e8e6;
  --gray-200:    #d0d0ce;
  --gray-400:    #999997;
  --gray-600:    #555553;
  --black:       #111110;
  --gold:        #f5c800;
  --gold-light:  #f5c800;
  --gold-bg:     #fffbe6;
  --gold-border: #f5c800;

  --ok:    #16a34a;
  --ok-bg: #dcfce7;
  --warn:    #b45309;
  --warn-bg: #fef3c7;
  --bad:    #b91c1c;
  --bad-bg: #fee2e2;
  --info:    #1d4ed8;
  --info-bg: #dbeafe;

  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.09);
  --shadow-lg: 0 20px 56px rgba(0,0,0,0.12);
  --ease: 0.2s ease;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Raleway', sans-serif;
  background: #efefed;
  color: var(--black);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hidden { display: none !important; }
.muted  { color: var(--gray-400); }
.small  { font-size: 12px; }
.mono   { font-family: 'Raleway', monospace; }

/* ===========================
   TOPBAR
=========================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-left h1 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--black);
}

.topbar-left p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 400;
}

.topbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===========================
   CARD
=========================== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ===========================
   TABS
=========================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.tab {
  flex: 1;
  padding: 13px 12px;
  background: transparent;
  border: none;
  color: var(--gray-400);
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  transition: color var(--ease), background var(--ease), border-bottom var(--ease);
  border-bottom: 2px solid transparent;
}

.tab:hover { color: var(--black); }

.tab.active {
  color: var(--black);
  background: var(--white);
  border-bottom: 2px solid var(--gold-light);
}

/* ===========================
   CARD BODY
=========================== */
.card-body {
  padding: 24px;
}

.card-body h2 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--black);
}

.card-body > p {
  margin: 0 0 20px;
  color: var(--gray-600);
  font-weight: 300;
  font-size: 14px;
}

/* ===========================
   FORM
=========================== */
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 7px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--black);
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

input::placeholder,
textarea::placeholder { color: var(--gray-400); font-weight: 300; }

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(245,200,0,0.15);
}

input:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

textarea { min-height: 110px; resize: vertical; }

/* ===========================
   BUTTONS
=========================== */
.btn {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--black);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.btn:hover {
  border-color: var(--gray-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.btn.primary:hover {
  background: #2a2a28;
  border-color: #2a2a28;
  box-shadow: 0 5px 18px rgba(0,0,0,0.22);
}

.btn.danger {
  border-color: #fecaca;
  color: var(--bad);
  background: #fff5f5;
}

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

.btn.full { grid-column: 1 / -1; width: 100%; }

.btn.mini {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

/* ===========================
   FILTERS
=========================== */
.filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
  margin-bottom: 16px;
  align-items: end;
}

/* ===========================
   TABLE
=========================== */
.tableWrap {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: center;
  padding: 12px 14px;
  color: var(--gray-600);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-weight: 400;
  text-align: center;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

.empty {
  padding: 32px;
  text-align: center;
  color: var(--gray-400);
  font-weight: 300;
}

/* ===========================
   PILLS / BADGES
=========================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.dot { width: 7px; height: 7px; border-radius: 50%; }

.pill.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: #bbf7d0; }
.pill.ok   .dot { background: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.pill.warn .dot { background: var(--warn); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad);  border-color: #fecaca; }
.pill.bad  .dot { background: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }
.pill.info .dot { background: var(--info); }

/* CRITICAL badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.critical {
  background: var(--bad-bg);
  border: 1px solid #fecaca;
  color: var(--bad);
}

.badge.critical .dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(185,28,28,0.15);
}

.blink { animation: blink 1s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ===========================
   AGE INDICATOR
=========================== */
.age {
  font-weight: 700;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
}

.age.ok   { background: var(--ok-bg);   color: var(--ok); }
.age.warn { background: var(--warn-bg); color: var(--warn); }
.age.bad  { background: var(--bad-bg);  color: var(--bad); }
.age.info { background: var(--info-bg); color: var(--info); }

/* ===========================
   ROW ACTIONS
=========================== */
.rowActions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.miniBtn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.miniBtn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

.miniBtn svg { pointer-events: none; }

/* ===========================
   BADGE PENDENTES
=========================== */
.badgePendentes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bad-bg);
  border: 1px solid #fecaca;
  color: var(--bad);
}

.badgePendentes .dotAlert {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bad);
}

/* ===========================
   MODAL
=========================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-content {
  width: min(720px, 100%);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
}

.modal-head h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
}

.modal-body { padding: 20px; }

.modal-actions {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--gray-50);
}

/* Modal view */
.modalCard {
  width: min(560px, 100%);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modalHeader {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
}

.modalHeader h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
}

.modalHeader button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background var(--ease), color var(--ease);
}

.modalHeader button:hover { background: var(--gray-100); color: var(--black); }

.modalBody {
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--black);
}

.modalBody p { margin-bottom: 8px; }
.modalBody b { font-weight: 600; }

/* ===========================
   EXPAND ROW
=========================== */
.expandRow td {
  animation: fadeExpand 0.2s ease;
  background: var(--gray-50);
  font-size: 13.5px;
  line-height: 1.65;
}

@keyframes fadeExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 980px) {
  .form { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .filters { grid-template-columns: 1fr; }
  .card-body { padding: 16px; }
  .modal-content, .modalCard { border-radius: 10px; }
}

/* ===========================
   MODAL PEQUENO (pause/finalizar)
=========================== */
.modal-sm {
  width: min(480px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.modal-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pause-icon {
  background: #f5c800;
  color: #111110;
  border: 1px solid #e0b800;
}

.finish-icon {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #bbf7d0;
}

.modal-head h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
  margin: 0 0 3px;
}

.modal-head p {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 300;
  margin: 0;
}

.req-dot { color: var(--gold); }

/* Botão pause (amarelo) */
.warn-btn {
  background: #f5c800;
  color: #111110;
  border: 1.5px solid #f5c800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.warn-btn:hover {
  background: #e0b800;
  border-color: #e0b800;
  transform: translateY(-1px);
}

/* Botão finalizar (verde) */
.finish-btn {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1.5px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.finish-btn:hover {
  background: #bbf7d0;
  border-color: var(--ok);
  transform: translateY(-1px);
}

/* ===========================
   MODAL VIEW — POPUP CHAMADO
=========================== */
.view-card {
  width: min(580px, 100%);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.view-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.view-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  margin-top: 3px;
}

.view-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
  margin: 0 0 4px;
}

.view-subtitle {
  font-size: 12.5px;
  color: var(--gray-400);
  font-weight: 400;
}

.view-close {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px 9px;
  transition: background var(--ease), color var(--ease);
  flex-shrink: 0;
}

.view-close:hover { background: var(--gray-100); color: var(--black); }

/* Meta row */
.view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}

.view-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 100px;
}

.view-meta-item .meta-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray-400);
}

.view-meta-item .meta-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
}

/* Scrollable body */
.view-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sections */
.view-section {
  border-radius: 10px;
  border: 1px solid var(--gray-100);
  padding: 14px 16px;
  background: var(--gray-50);
}

.view-section-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.view-section-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.view-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.view-section-label.warn { color: var(--warn); }
.view-section-label.ok   { color: var(--ok); }

.view-section-date {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gray-400);
}

.view-text {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--gray-600);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer */
.view-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  background: var(--gray-50);
}

/* Ícone prioridade */
.prio-icon {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Botão prioridade na tabela */
.miniBtn-prio {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.miniBtn-prio:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

/* ===========================
   BOTÃO REATRIBUIR
=========================== */
.miniBtn-reattr {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.miniBtn-reattr:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

/* ===========================
   PILLS DE PRIORIDADE
=========================== */
.pill.prio-baixa  { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.pill.prio-baixa  .dot { background: #16a34a; }

.pill.prio-media  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill.prio-media  .dot { background: #1d4ed8; }

.pill.prio-alta   { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.pill.prio-alta   .dot { background: #b45309; }

.pill.prio-critica { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.pill.prio-critica .dot { background: #b91c1c; }

/* ===========================
   TIMELINE
=========================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}

.tl-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tl-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid transparent;
}

.tl-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: var(--gray-100);
  margin: 3px 0;
}

.tl-body {
  padding-bottom: 18px;
  flex: 1;
}

.tl-last .tl-body { padding-bottom: 4px; }

.tl-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 2px;
}

.tl-desc {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tl-date {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* cores dos dots */
.tl-aberto     { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tl-andamento  { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tl-pausado    { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.tl-retomado   { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tl-reattr     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tl-prio       { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.tl-finalizado { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.tl-edit       { background: var(--gray-50); color: var(--gray-600); border-color: var(--gray-200); }
.tl-default    { background: var(--gray-50); color: var(--gray-600); border-color: var(--gray-200); }

/* view-card maior para acomodar timeline */
.view-card {
  width: min(660px, 100%) !important;
  max-height: 92vh !important;
}
