/* ============================================================
   Sistema de Tickets — Soporte TIC · CTG
   Paleta institucional ámbar sobre VÍA design system
   ============================================================ */

:root {
  --ctg-900: #7A4D00;
  --ctg-700: #B97800;
  --ctg-500: #F7A000;
  --ctg-300: #F9B333;
  --ctg-100: #FDECCC;
  --ctg-50:  #FFF8ED;
  --gray-900: #1a1a1a;
  --gray-700: #444;
  --gray-500: #777;
  --gray-300: #ccc;
  --gray-100: #f4f5f7;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

/* ── Reset / Base ── */
body {
  background: var(--gray-100);
  color: var(--gray-900);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Navbar ── */
.stk-navbar {
  background: #fff;
  border-bottom: 3px solid var(--ctg-500);
  box-shadow: var(--shadow-sm);
  padding: .5rem 1rem;
}
.stk-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ctg-700) !important;
}
.stk-navbar .nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .875rem;
  color: var(--gray-700);
  border-radius: 6px;
  padding: .4rem .7rem;
  transition: background .15s;
}
.stk-navbar .nav-link:hover { background: var(--ctg-50); color: var(--ctg-700); }
.stk-navbar .nav-link.active { background: var(--ctg-100); color: var(--ctg-700); font-weight: 600; }
.stk-navbar .nav-link .material-icons-outlined { font-size: 20px; }

.stk-user-info {
  font-size: .82rem;
  cursor: default !important;
}
.stk-role-badge {
  display: inline-block;
  background: var(--ctg-100);
  color: var(--ctg-700);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  margin-left: 4px;
}

/* ── Main content ── */
.stk-main {
  min-height: calc(100vh - 160px);
  padding: 1.5rem;
}
.stk-main .container-fluid { max-width: 1200px; }

/* ── Cards ── */
.stk-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stk-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stk-card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stk-card-body { padding: 1.25rem; }

/* ── Dashboard metric cards ── */
.stk-metric {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.stk-metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stk-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stk-metric-icon .material-icons-outlined { font-size: 26px; color: #fff; }
.stk-metric-icon.abierto     { background: #e74c3c; }
.stk-metric-icon.en-progreso { background: var(--ctg-500); }
.stk-metric-icon.resuelto    { background: #27ae60; }
.stk-metric-icon.total       { background: #2c3e50; }
.stk-metric-value { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--gray-900); }
.stk-metric-label { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

/* ── Ticket list table ── */
.stk-table {
  width: 100%;
  font-size: .875rem;
}
.stk-table thead th {
  background: var(--ctg-50);
  padding: .6rem .75rem;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700);
  border-bottom: 2px solid var(--ctg-300);
  white-space: nowrap;
}
.stk-table tbody td {
  padding: .65rem .75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}
.stk-table tbody tr:hover { background: var(--ctg-50); }
.stk-table .ticket-numero {
  font-weight: 700;
  color: var(--ctg-700);
  text-decoration: none;
  white-space: nowrap;
}
.stk-table .ticket-numero:hover { color: var(--ctg-900); text-decoration: underline; }

/* ── Status badges ── */
.badge-estatus {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-abierto   { background: #fdecea; color: #c0392b; }
.badge-progreso  { background: #FFF3DC; color: #B97800; }
.badge-espera    { background: #edf2fb; color: #2563eb; }
.badge-resuelto  { background: #e8f8ef; color: #1e8449; }
.badge-cerrado   { background: #eee;    color: #777; }

/* ── Ticket detail ── */
.stk-ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.stk-ticket-numero {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ctg-700);
  letter-spacing: .5px;
}
.stk-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .85rem;
  color: var(--gray-500);
}
.stk-ticket-meta strong { color: var(--gray-700); }

/* ── Comentarios timeline ── */
.stk-timeline { list-style: none; padding: 0; margin: 0; }
.stk-timeline-item {
  position: relative;
  padding: 0 0 1.5rem 32px;
  border-left: 2px solid #e8e8e8;
  margin-left: 12px;
}
.stk-timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.stk-timeline-dot {
  position: absolute;
  left: -8px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ctg-500);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--ctg-300);
}
.stk-timeline-item.is-system .stk-timeline-dot { background: var(--gray-300); box-shadow: none; }
.stk-timeline-item.is-internal .stk-timeline-dot { background: #2563eb; box-shadow: 0 0 0 2px #93b4f5; }

.stk-timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  margin-bottom: 6px;
}
.stk-timeline-author { font-weight: 700; color: var(--gray-900); }
.stk-timeline-time   { color: var(--gray-500); }
.stk-timeline-body {
  background: #f8f9fa;
  border-radius: 6px;
  padding: .75rem 1rem;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--gray-700);
}
.stk-timeline-item.is-internal .stk-timeline-body {
  background: #edf2fb;
  border-left: 3px solid #2563eb;
}

/* ── Estadísticas ── */
.stk-chart-wrap {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stk-chart-wrap h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Login ── */
.stk-login-card {
  max-width: 420px;
  margin: 0 auto;
  margin-top: 5vh;
}
.stk-login-card .stk-card-header {
  background: var(--ctg-500);
  border-bottom: none;
  justify-content: center;
  padding: 1.5rem;
}
.stk-login-card .stk-card-header h2 { color: #fff; font-size: 1.1rem; }
.stk-login-card .stk-card-header .material-icons-outlined { color: #fff; }

/* ── Botones ── */
.btn-ctg {
  background: var(--ctg-500);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .5rem 1.25rem;
  border-radius: 6px;
  font-size: .875rem;
  transition: background .15s;
}
.btn-ctg:hover { background: var(--ctg-700); color: #fff; }
.btn-ctg-outline {
  background: transparent;
  border: 1.5px solid var(--ctg-500);
  color: var(--ctg-700);
  font-weight: 600;
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  transition: all .15s;
}
.btn-ctg-outline:hover { background: var(--ctg-500); color: #fff; }

/* ── Forms ── */
.form-label { font-weight: 600; font-size: .85rem; color: var(--gray-700); }
.form-control:focus, .form-select:focus {
  border-color: var(--ctg-300);
  box-shadow: 0 0 0 3px rgba(249, 179, 51, .2);
}

/* ── Filter bar ── */
.stk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 1rem;
}
.stk-filters .form-select, .stk-filters .form-control {
  font-size: .82rem;
  max-width: 180px;
}

/* ── Footer ── */
.stk-footer {
  padding: 1rem;
  text-align: center;
  font-size: .75rem;
  color: var(--gray-500);
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

/* ── Pagination ── */
.pagination .page-link { color: var(--ctg-700); font-size: .85rem; }
.pagination .page-item.active .page-link {
  background: var(--ctg-500);
  border-color: var(--ctg-500);
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .stk-main { padding: 1rem .75rem; }
  .stk-filters .form-select, .stk-filters .form-control { max-width: 100%; }
  .stk-ticket-header { flex-direction: column; }
  .stk-table { font-size: .8rem; }
}