/* Colombia Raíz - paleta de marca:
   azul #1C6ADE, naranja #F44F1C, amarillo #F6D538, rosa #EEC3CD, negro #1B1A1C */

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  color: #1f2430;
  min-height: 100vh;
  background-color: #fbfaf8;
  background-image:
    radial-gradient(circle at 10% -10%, rgba(28,106,222,.14), transparent 42%),
    radial-gradient(circle at 105% 10%, rgba(244,79,28,.14), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(246,213,56,.16), transparent 42%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  line-height: 1.5;
}

header.top {
  background: #1b1a1c;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
header.top a { color: #fff; text-decoration: none; }
header.top .brand { display: flex; align-items: center; gap: 10px; }
header.top .brand img {
  height: 30px;
  width: 30px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
}
header.top .brand strong { font-size: 14.5px; letter-spacing: .2px; }
header.top .nav-links { display: flex; align-items: center; gap: 16px; font-size: 13.5px; flex-wrap: wrap; row-gap: 6px; }
header.top .nav-links a { opacity: .85; }
header.top .nav-links a:hover { opacity: 1; text-decoration: underline; }
header.top .nav-links a.active { opacity: 1; font-weight: 700; text-decoration: underline; }
header.top .nav-links span { opacity: .65; }

.wrap { max-width: 860px; width: 100%; min-width: 0; margin: 32px auto; padding: 0 16px; }
.wrap-wide { max-width: 1080px; }

.login-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-wrap > .wrap { width: 100%; max-width: 400px; margin: 0; }

.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { height: 52px; max-width: 100%; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(27,26,28,.07);
  margin-bottom: 18px;
  border: 1px solid rgba(27,26,28,.05);
}

h1 { margin-top: 0; font-size: 20px; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 700; }
label { display: block; margin-bottom: 14px; font-size: 13.5px; }
input, textarea, select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1C6ADE;
  box-shadow: 0 0 0 3px rgba(28,106,222,.13);
}

button {
  background: #F44F1C;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
button:hover { background: #d94314; }

.error { color: #b91c1c; background: #fef1f0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.success { color: #065f46; background: #edf9f3; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }

/* --- Tabla (desktop, >700px) --- */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #f0efec;
  font-size: 13.5px;
  vertical-align: middle;
}
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; font-weight: 600; }
td.nowrap, th.nowrap { white-space: nowrap; }
tbody tr:hover { background: #faf9f7; }

/* --- Tarjetas (mobile, <=700px) --- */
.cases-list { display: none; }
.case-card {
  border: 1px solid #f0efec;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.case-card + .case-card { margin-top: 10px; }
a.case-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
a.case-card:hover {
  border-color: #1C6ADE;
  box-shadow: 0 2px 10px rgba(28,106,222,.1);
}
.case-card .case-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.case-card .case-ticket { font-size: 12px; color: #9ca3af; font-weight: 600; }
.case-card .case-subject { font-size: 14.5px; font-weight: 600; margin: 2px 0 8px; }
.case-card .case-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; color: #6b7280; margin-bottom: 8px; }
.case-card .case-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

@media (max-width: 700px) {
  .desktop-table { display: none; }
  .cases-list { display: block; }
}

.badge { padding: 3px 9px; border-radius: 12px; font-size: 12px; background: #f6d538; color: #1b1a1c; font-weight: 600; white-space: nowrap; display: inline-block; }
.badge-new { background: #f6d538; color: #1b1a1c; }
.badge-progress { background: #1C6ADE; color: #fff; }
.badge-done { background: #1b1a1c; color: #fff; }
.sla-breached { color: #b91c1c; font-weight: 600; }
.empty { color: #6b7280; font-size: 13.5px; }
.hint { display: block; color: #9ca3af; font-size: 12px; margin-top: 4px; font-weight: 400; }
.actions { margin-top: 16px; }
.muted { color: #9ca3af; }

.link-btn {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 6px;
  background: #eef3fd;
  color: #1C6ADE;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.link-btn:hover { background: #dbe6fd; }

/* Estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.stat-tile {
  background: #fcfcfb;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #f0efec;
}
.stat-value { font-size: 26px; font-weight: 700; color: #1b1a1c; line-height: 1.1; }
.stat-label { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.stat-tile.alert .stat-value { color: #b91c1c; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { width: 170px; max-width: 42%; font-size: 12.5px; flex-shrink: 0; }
.bar-track { flex: 1; background: #f4f3f1; border-radius: 6px; height: 16px; overflow: hidden; min-width: 0; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 3px; }
.bar-count { width: 26px; text-align: right; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
