:root {
  --itg-blue: #47b2e4;
  --itg-dark: #37517e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Poppins, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at top left, rgba(71, 178, 228, 0.16), transparent 50%),
    linear-gradient(160deg, #f4f8fb 0%, #e8eef5 100%);
}

.tk-header {
  background: #fff;
  border-bottom: 1px solid #e5ecf3;
  padding: 0.85rem 0;
  margin-bottom: 1.75rem;
}

.tk-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.tk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--itg-dark);
  font-weight: 600;
}

.tk-brand img { height: 34px; }

.tk-nav {
  display: flex;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}

.tk-nav a {
  text-decoration: none;
  color: #5a6a85;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
}

.tk-nav a:hover,
.tk-nav a.active {
  color: var(--itg-blue);
  background: rgba(71, 178, 228, 0.12);
}

.tk-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  font-size: 0.85rem;
}

.tk-badge {
  background: var(--itg-dark);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
}

.tk-user-name { color: #5a6a85; }

.tk-logout {
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  color: var(--itg-dark);
}

.tk-logout:hover {
  border-color: var(--itg-blue);
  color: var(--itg-blue);
}

.tk-main { padding-bottom: 3rem; }

.tk-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 14px 36px rgba(55, 81, 126, 0.08);
  margin-bottom: 1.25rem;
}

.tk-card h1 {
  font-size: 1.4rem;
  color: var(--itg-dark);
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.tk-card .sub {
  color: #6c757d;
  margin-bottom: 1.25rem;
}

.tk-card h2 {
  font-size: 1.05rem;
  color: var(--itg-dark);
  font-weight: 600;
  margin: 0 0 1rem;
}

label { font-weight: 500; color: var(--itg-dark); font-size: 0.9rem; }

.form-control, .form-select {
  border-radius: 10px;
  border-color: #d7e0ea;
  padding: 0.65rem 0.85rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--itg-blue);
  box-shadow: 0 0 0 0.2rem rgba(71, 178, 228, 0.2);
}

.btn-itg {
  background: var(--itg-blue);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 0.65rem 1.2rem;
  font-weight: 600;
}

.btn-itg:hover { background: #3aa3d4; color: #fff; }

.btn-ghost {
  border: 1px solid #d7e0ea;
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  color: var(--itg-dark);
  text-decoration: none;
  display: inline-block;
}

.btn-ghost:hover {
  border-color: var(--itg-blue);
  color: var(--itg-blue);
}

.table thead th {
  color: var(--itg-dark);
  font-size: 0.85rem;
  border-bottom-color: #e5ecf3;
}

.table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-open { background: #e7f5ff; color: #1c7ed6; }
.status-in_progress { background: #fff3bf; color: #e67700; }
.status-closed { background: #ebfbee; color: #2b8a3e; }

.tk-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.tk-ticket-meta {
  color: #6c757d;
  font-size: 0.9rem;
}

.tk-details {
  border: 1px solid #e5ecf3;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.tk-detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #eef2f6;
  font-size: 0.92rem;
}

.tk-detail-row:last-child { border-bottom: none; }

.tk-detail-row span {
  color: #6c757d;
}

.tk-detail-row strong {
  color: var(--itg-dark);
  font-weight: 600;
  word-break: break-word;
}

.tk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e5ecf3;
}

.tk-status-form { flex: 1; min-width: 220px; }

.tk-status-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.tk-status-row .form-select {
  max-width: 200px;
}

.btn-danger-ghost {
  color: #c92a2a !important;
  border-color: #f1aeb5 !important;
}

.tk-thread h2 {
  margin-bottom: 0.85rem;
}

.tk-empty {
  color: #6c757d;
  margin: 0 0 1rem;
}

.tk-msg {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e5ecf3;
}

.tk-msg-firma {
  background: #eef7fc;
  border-color: #cfe8f6;
}

.tk-msg-primalac {
  background: #f8fafc;
}

.tk-msg-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.tk-msg-top strong { color: var(--itg-dark); }

.tk-msg-top em {
  font-style: normal;
  background: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  color: #5a6a85;
  border: 1px solid #e5ecf3;
  font-size: 0.75rem;
}

.tk-msg-top span { color: #8a96a8; }

.tk-msg-body {
  color: #2f3b4f;
  line-height: 1.45;
  white-space: normal;
}

.tk-reply-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5ecf3;
}

.tk-reply-form .form-control {
  margin-bottom: 0.75rem;
}

.reply-box {
  border: 1px solid #e5ecf3;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  background: #f8fafc;
}

.reply-meta {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.35rem;
}

@media (max-width: 576px) {
  .tk-detail-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 50px rgba(55, 81, 126, 0.12);
}

.login-card h1 {
  font-size: 1.35rem;
  color: var(--itg-dark);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(55, 81, 126, 0.07);
}

.stat .n {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--itg-dark);
}

.stat .l { font-size: 0.8rem; color: #6c757d; }
