:root {
  --blue-900: #0b3d5c;
  --blue-700: #0f6796;
  --blue-500: #1b8fc4;
  --blue-100: #e6f4fb;
  --gray-900: #1f2933;
  --gray-600: #52606d;
  --gray-300: #d9e2ec;
  --gray-100: #f5f8fa;
  --white: #ffffff;
  --green: #1a7f5a;
  --amber: #b5720b;
  --red: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
}

a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--blue-900);
  color: var(--white);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 32px;
  width: 32px;
  border-radius: 6px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav a { color: var(--blue-100); font-size: 0.95rem; }
.nav a:hover { color: var(--white); }

.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.card-narrow { max-width: 480px; margin-left: auto; margin-right: auto; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; color: var(--blue-900); }
h2 { font-size: 1.15rem; margin-top: 2rem; color: var(--blue-900); }
h3 { font-size: 1rem; color: var(--blue-900); margin-top: 1.5rem; }

.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--gray-600); flex: 1; min-width: 160px; }

input, select, textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-500); border-color: var(--blue-500); }

.password-field { position: relative; display: flex; }
.password-field input[type="password"],
.password-field input[type="text"] { flex: 1; padding-right: 2.4rem; }
.toggle-password {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--blue-700); color: var(--white); }
.btn-primary:hover { background: var(--blue-900); text-decoration: none; }
.btn-secondary { background: var(--gray-300); color: var(--gray-900); }
.btn-secondary:hover { background: var(--gray-600); color: var(--white); text-decoration: none; }
.btn-danger { background: var(--red); color: var(--white); margin-top: 0.5rem; }

.link-button {
  background: none;
  border: none;
  color: var(--blue-700);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}
.inline-form { display: inline; }

.filters { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--gray-300); font-size: 0.92rem; }
.table th { color: var(--gray-600); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-status-aberto { background: var(--blue-100); color: var(--blue-700); }
.badge-status-em_andamento { background: #fff3d6; color: var(--amber); }
.badge-status-resolvido { background: #e1f5ec; color: var(--green); }
.badge-status-fechado { background: var(--gray-300); color: var(--gray-600); }
.badge-priority-baixa { background: #e1f5ec; color: var(--green); }
.badge-priority-media { background: #fff3d6; color: var(--amber); }
.badge-priority-alta { background: #fbe3e1; color: var(--red); }

.role-tag {
  font-size: 0.75rem;
  background: var(--gray-300);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.4rem;
}

.alert { padding: 0.7rem 1rem; border-radius: 6px; font-size: 0.9rem; }
.alert-error { background: #fbe3e1; color: var(--red); }
.alert-success { background: #e1f5ec; color: var(--green); }

.empty { color: var(--gray-600); font-style: italic; }

.ticket-meta { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.9rem; color: var(--gray-600); margin-bottom: 1rem; }
.ticket-description { white-space: pre-wrap; background: var(--gray-100); padding: 1rem; border-radius: 6px; }

.attachment-list, .comment-list, .article-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.article-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--gray-300); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.article-meta { font-size: 0.85rem; color: var(--gray-600); }

.comment { border: 1px solid var(--gray-300); border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 0.75rem; }
.comment-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; font-size: 0.9rem; }
.comment-date { color: var(--gray-600); font-size: 0.8rem; margin-left: auto; }
.comment p { margin: 0; white-space: pre-wrap; }

.article-body { white-space: pre-wrap; margin-top: 1rem; }

.footer { text-align: center; color: var(--gray-600); font-size: 0.85rem; padding: 2rem 0; }
