:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #142033;
  --muted: #6e7b90;
  --line: #e3e9f1;

  --blue: #1565d8;
  --blue-dark: #0c4fae;
  --blue-soft: #edf5ff;

  --green: #14865c;
  --green-soft: #e8f7ef;

  --red: #c63f4a;
  --red-soft: #ffecee;

  --orange: #c87512;
  --orange-soft: #fff3dc;

  --purple: #6d54b8;
  --purple-soft: #f2efff;

  --sidebar: #0e1d31;
  --sidebar-active: #173150;

  --shadow: 0 10px 30px rgba(27, 50, 79, 0.07);
}

/* ===================================================== */
/* GENERAL */
/* ===================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* ===================================================== */
/* BOTONES */
/* ===================================================== */

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn.secondary {
  background: var(--blue-soft);
  color: var(--blue);
}

.btn.secondary:hover {
  background: #dfedfc;
}

.btn.ghost {
  background: #f1f4f8;
  color: #526174;
}

.btn.ghost:hover {
  background: #e8edf3;
}

.btn.danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f2c8cd;
}

.btn.danger:hover {
  background: #ffdfe3;
  color: #9f1f2d;
  border-color: #e9aeb5;
}
.btn.full {
  width: 100%;
  margin-top: 15px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

/* ===================================================== */
/* LOGIN */
/* ===================================================== */

.login-view {
  min-height: 100vh;

  display: grid;
  place-items: center;

  padding: 20px;

  background:
    radial-gradient(circle at 15% 10%, #e3efff, transparent 35%),
    linear-gradient(135deg, #f9fbfe, #eef4fb);
}

.login-card {
  width: min(430px, 100%);

  padding: 36px;

  border: 1px solid #e5edf7;
  border-radius: 22px;

  background: #ffffff;

  box-shadow: 0 24px 70px rgba(20, 57, 100, 0.15);
}

.login-logo-area {
  width: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  margin-bottom: 26px;

  text-align: center;
}

.login-company-logo {
  display: block;

  width: min(240px, 75%);
  height: auto;

  margin: 0 auto;

  object-fit: contain;
  object-position: center;
}

.login-card > p {
  margin: 0 0 30px;

  color: #738195;

  text-align: center;

  font-size: 13px;
  line-height: 1.5;
}

.login-card label {
  display: block;

  margin: 0 0 8px;

  color: #526174;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.login-card input {
  display: block;

  width: 100%;
  height: 46px;

  margin: 0;

  padding: 0 13px;

  border: 1px solid #dfe5ec;
  border-radius: 10px;

  background: #ffffff;
  color: #26374b;

  outline: none;

  font-size: 13px;
  font-weight: 500;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.login-card input::placeholder {
  color: #9aa7b7;
  font-weight: 400;
}

.login-card input:focus {
  border-color: #8bbaf7;

  background: #ffffff;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.08);
}

.login-card #loginUser {
  margin-bottom: 20px;
}

.login-card #loginPass {
  margin-bottom: 0;
}

.login-card .btn.full {
  width: 100%;

  margin-top: 24px;
}

/* ===================================================== */
/* APP */
/* ===================================================== */

.app {
  min-height: 100vh;

  display: grid;

  grid-template-columns:
    250px
    minmax(0, 1fr);
}

/* ===================================================== */
/* SIDEBAR */
/* ===================================================== */

.sidebar {
  position: sticky;
  top: 0;

  height: 100vh;

  background: var(--sidebar);
  color: #dbe7f7;

  padding: 22px 15px;

  display: flex;
  flex-direction: column;

  z-index: 20;
}

.logo-area {
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 4px 8px 18px;
  text-align: center;
}

.sidebar-company-logo {
  display: block;

  width: 145px;
  max-width: 100%;
  height: auto;

  margin: 0 auto;

  object-fit: contain;
  object-position: center;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 12px;

  border: 0;
  border-radius: 10px;

  padding: 11px 13px;

  background: transparent;

  color: #9eb0c9;

  text-align: left;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-icon {
  width: 18px;
  text-align: center;
}

.nav-item b {
  margin-left: auto;

  padding: 2px 7px;

  border-radius: 20px;

  background: #2d7eea;
  color: #fff;

  font-size: 10px;
}

.sidebar-bottom {
  margin-top: auto;
}

/* ===================================================== */
/* MAIN */
/* ===================================================== */

.main {
  min-width: 0;
}

/* ===================================================== */
/* TOPBAR */
/* ===================================================== */

.topbar {
  min-height: 88px;

  padding: 18px 28px;

  background: rgba(255, 255, 255, 0.94);

  border-bottom: 1px solid var(--line);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  position: sticky;
  top: 0;

  z-index: 10;

  backdrop-filter: blur(10px);
}

.topbar p {
  margin: 0 0 4px;

  color: #8a96a8;

  font-size: 11px;
}

.topbar h2 {
  margin: 0;

  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar input {
  width: 290px;
  height: 42px;

  padding: 0 12px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: #fff;

  outline: none;
}

.topbar input:focus {
  border-color: #8bbaf7;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.08);
}

/* ===================================================== */
/* VIEWS */
/* ===================================================== */

.view {
  display: none;

  padding: 27px 28px 44px;
}

.active-view {
  display: block;
}

/* ===================================================== */
/* DASHBOARD HEADER */
/* ===================================================== */

.dashboard-header,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 24px;

  margin-bottom: 24px;
}

.dashboard-header h3,
.section-header h3 {
  margin: 5px 0 6px;

  color: #13243a;

  font-size: 27px;
}

.dashboard-header p,
.section-header p {
  margin: 0;

  max-width: 680px;

  color: #738195;

  font-size: 13px;
  line-height: 1.55;
}

.dashboard-eyebrow,
.panel-eyebrow {
  display: block;

  color: #718096;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 1.2px;
}

/* ===================================================== */
/* PANELS */
/* ===================================================== */

.panel {
  background: var(--panel);

  border: 1px solid var(--line);
  border-radius: 15px;

  padding: 18px;

  box-shadow: var(--shadow);
}

.panel h3 {
  margin-top: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 15px;
}

.panel-head h3 {
  margin: 5px 0;

  color: #26374b;

  font-size: 16px;
}

.panel-head p {
  margin: 0;

  color: #8490a0;

  font-size: 12px;
}

/* ===================================================== */
/* DASHBOARD KPI */
/* ===================================================== */

.dashboard-kpis {
  display: grid;

  grid-template-columns: repeat(6, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 20px;
}

.dashboard-kpi {
  min-height: 140px;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 14px;

  padding: 16px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  box-shadow: var(--shadow);
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.kpi-icon {
  width: 31px;
  height: 31px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: var(--blue-soft);
  color: var(--blue);

  font-weight: 800;
}

.kpi-label {
  color: #5d6d80;

  font-size: 12px;
}

.dashboard-kpi strong {
  margin-top: 12px;

  color: #18283c;

  font-size: 28px;
}

.dashboard-kpi small {
  color: #8793a3;

  font-size: 10px;
  line-height: 1.4;
}

/* ===================================================== */
/* DASHBOARD ALERT */
/* ===================================================== */

.dashboard-alert {
  background: #fff8ec;

  border: 1px solid #f2dfb5;
  border-radius: 13px;

  padding: 14px 17px;

  margin-bottom: 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 20px;
}

.dashboard-alert > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-icon {
  width: 38px;
  height: 38px;

  border-radius: 9px;

  display: grid;
  place-items: center;

  background: #f8e8bd;
  color: #8c6713;

  font-weight: 800;
}

.dashboard-alert strong {
  color: #3d4651;

  font-size: 13px;
}

.dashboard-alert p {
  margin: 3px 0 0;

  color: #747d89;

  font-size: 11px;
}

/* ===================================================== */
/* DASHBOARD GRIDS */
/* ===================================================== */

.dashboard-grid-main {
  display: grid;

  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(300px, 0.8fr);

  gap: 18px;

  margin-bottom: 18px;
}

.dashboard-panel {
  min-height: 310px;
}

.dashboard-grid-secondary {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;
}

.dashboard-summary-card {
  min-height: 105px;

  display: flex;
  align-items: center;
  gap: 13px;
}

.summary-icon {
  width: 43px;
  height: 43px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: var(--blue-soft);
  color: var(--blue);

  font-size: 17px;
}

.dashboard-summary-card span {
  display: block;

  color: #677587;

  font-size: 11px;
}

.dashboard-summary-card strong {
  display: block;

  margin: 3px 0;

  color: #26364a;

  font-size: 23px;
}

.dashboard-summary-card small {
  color: #919ba8;

  font-size: 10px;
}

/* ===================================================== */
/* DASHBOARD LIST */
/* ===================================================== */

.dashboard-ticket-list,
.activity-list {
  margin-top: 14px;
}

.dashboard-ticket-item {
  display: grid;

  grid-template-columns:
    90px
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 12px;

  padding: 13px 0;

  border-bottom: 1px solid #edf0f4;

  cursor: pointer;
}

.dashboard-ticket-item:last-child {
  border-bottom: 0;
}

.dashboard-ticket-code {
  color: var(--blue);

  font-size: 11px;
  font-weight: 800;
}

.dashboard-ticket-content strong {
  display: block;

  margin-bottom: 3px;

  color: #26374b;

  font-size: 12px;
}

.dashboard-ticket-content small {
  color: #8794a4;

  font-size: 10px;
}

.dashboard-ticket-item:hover {
  background: #fafcff;
}

.activity-item {
  display: flex;
  gap: 11px;

  padding: 11px 0;

  border-bottom: 1px solid #edf0f4;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;

  margin-top: 5px;

  flex-shrink: 0;

  border-radius: 50%;

  background: var(--blue);
}

.activity-item strong {
  display: block;

  color: #344457;

  font-size: 12px;
}

.activity-item p {
  margin: 3px 0;

  color: #657386;

  font-size: 11px;
}

.activity-item small {
  color: #8995a4;

  font-size: 10px;
}

/* ===================================================== */
/* FILTERS */
/* ===================================================== */

.ticket-toolbar {
  display: grid;

  grid-template-columns:
    minmax(250px, 1fr)
    190px
    190px
    200px;

  gap: 11px;

  margin-bottom: 16px;
}

.ticket-toolbar input,
.ticket-toolbar select {
  width: 100%;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #fff;

  color: #344457;

  outline: none;
}

.ticket-toolbar input:focus,
.ticket-toolbar select:focus {
  border-color: #7caee4;
}

/* ===================================================== */
/* TABLAS */
/* ===================================================== */

.ticket-table-panel {
  padding: 0;

  overflow: hidden;
}

.table-responsive {
  width: 100%;

  overflow-x: auto;
}

.support-table {
  width: 100%;

  border-collapse: collapse;
}

.support-table th {
  padding: 12px 13px;

  background: #f7f9fb;

  border-bottom: 1px solid #e7ebf0;

  color: #758296;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.35px;
  text-transform: uppercase;

  text-align: left;

  white-space: nowrap;
}

.support-table td {
  padding: 13px;

  border-bottom: 1px solid #edf0f4;

  color: #435266;

  font-size: 11px;

  vertical-align: middle;
}

.support-table tbody tr:hover {
  background: #fafbfd;
}

.ticket-code {
  color: var(--blue);

  font-size: 11px;
  font-weight: 800;
}

.ticket-client {
  color: #29394d;

  font-weight: 700;
}

.ticket-identifiers {
  display: flex;
  flex-direction: column;
  gap: 3px;

  white-space: nowrap;
}

.ticket-identifiers strong {
  color: #3c4c60;

  font-size: 10px;
}

.ticket-identifiers small {
  color: #8a97a6;

  font-size: 10px;
}

.action-btn {
  border: 0;
  border-radius: 8px;

  padding: 7px 10px;

  background: var(--blue-soft);
  color: var(--blue);

  font-size: 10px;
  font-weight: 800;

  cursor: pointer;
}

.action-btn:hover {
  background: #dfeeff;
}

/* ===================================================== */
/* BADGES */
/* ===================================================== */

.ticket-badge,
.pill {
  display: inline-flex;
  align-items: center;

  min-height: 24px;

  padding: 4px 9px;

  border-radius: 20px;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
}

.priority-low,
.pill.Baja {
  background: #eef3f6;
  color: #637284;
}

.priority-medium,
.pill.Media {
  background: #edf4ff;
  color: #346bb4;
}

.priority-high,
.pill.Alta {
  background: #fff0e4;
  color: #b55d10;
}

.priority-critical,
.pill.Crítica {
  background: var(--red-soft);
  color: #ba3440;
}

.status-new,
.pill.Nuevo {
  background: #eaf3ff;
  color: #1762bd;
}

.status-diagnostic,
.pill.En-diagnóstico {
  background: var(--orange-soft);
  color: #a9630b;
}

.status-waiting,
.pill.Esperando-cliente {
  background: var(--purple-soft);
  color: var(--purple);
}

.status-escalated,
.pill.Escalado {
  background: var(--red-soft);
  color: #ba3440;
}

.status-resolved,
.status-closed,
.pill.Resuelto,
.pill.Cerrado {
  background: var(--green-soft);
  color: #167451;
}

/* ===================================================== */
/* KNOWLEDGE */
/* ===================================================== */

.knowledge-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 15px;
}

.tag {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 20px;

  background: var(--blue-soft);
  color: var(--blue);

  font-size: 9px;
  font-weight: 800;
}

/* ===================================================== */
/* MODALS */
/* ===================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(20, 32, 47, 0.5);

  display: flex;
  justify-content: center;
  align-items: flex-start;

  padding: 35px 20px;

  overflow-y: auto;

  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;

  background: #fff;

  border-radius: 16px;

  box-shadow: 0 25px 70px rgba(20, 38, 58, 0.25);

  overflow: hidden;
}

.modal-large {
  max-width: 940px;
}

.modal-medium {
  max-width: 760px;
}

.modal-ticket-detail {
  max-width: 1180px;
}

.modal-header,
.ticket-detail-header {
  padding: 21px 24px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 20px;

  border-bottom: 1px solid #e8ebef;
}

.modal-header h3,
.ticket-detail-header h3 {
  margin: 5px 0;

  color: #203146;
}

.modal-header p,
.ticket-detail-header p {
  margin: 0;

  color: #8692a1;

  font-size: 11px;
}

.modal-close {
  width: 35px;
  height: 35px;

  flex-shrink: 0;

  border: 0;
  border-radius: 9px;

  background: #f1f4f7;
  color: #637083;

  font-size: 20px;

  cursor: pointer;
}

.modal-close:hover {
  background: #e8edf3;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  padding: 17px 24px;

  border-top: 1px solid #e8ebef;

  background: #fafbfc;
}

/* ===================================================== */
/* FORMS */
/* ===================================================== */

.form-section {
  padding-bottom: 23px;
  margin-bottom: 23px;

  border-bottom: 1px solid #edf0f3;
}

.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;

  border-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;

  gap: 11px;

  margin-bottom: 17px;
}

.form-section-title > span {
  width: 32px;
  height: 32px;

  flex-shrink: 0;

  border-radius: 9px;

  background: var(--blue-soft);
  color: var(--blue);

  display: grid;
  place-items: center;

  font-size: 10px;
  font-weight: 800;
}

.form-section-title strong,
.form-section-title small {
  display: block;
}

.form-section-title strong {
  color: #304156;

  font-size: 13px;
}

.form-section-title small {
  margin-top: 2px;

  color: #8995a4;

  font-size: 10px;
}

.form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;

  gap: 6px;
}

.form-group label {
  color: #526174;

  font-size: 11px;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  padding: 10px 11px;

  background: #fff;
  color: #344457;

  outline: none;

  font-family: inherit;

  resize: vertical;
}

.form-group input,
.form-group select {
  min-height: 41px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #4c82b2;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

.form-space-top {
  margin-top: 15px;
}

.form-notice {
  margin-bottom: 15px;

  padding: 11px 13px;

  border: 1px solid #dce9f4;
  border-radius: 9px;

  background: #f4f8fc;
  color: #54708a;

  font-size: 10px;
  line-height: 1.5;
}

.form-notice.error {
  background: #fff0f0;

  border-color: #efcaca;

  color: #a34c4c;
}

.form-notice.success {
  background: #eef8f2;

  border-color: #cde8d6;

  color: #477a55;
}

.date-input-wrapper {
  width: 100%;

  min-width: 0;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  padding: 9px 11px;

  background: #fff;
}

.date-input-wrapper input[type="date"] {
  width: 100%;
  min-width: 0;

  border: 0;
  padding: 0;

  outline: none;

  background: transparent;
}

/* ===================================================== */
/* TICKET DETAIL */
/* ===================================================== */

.ticket-detail-code-row {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 7px;
}

.ticket-detail-code {
  color: var(--blue);

  font-size: 11px;
  font-weight: 800;
}

.ticket-detail-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    300px;

  align-items: start;
}

.ticket-detail-main {
  padding: 24px;

  border-right: 1px solid #e8ebef;
}

.ticket-detail-sidebar {
  padding: 20px;

  background: #fafbfc;
}

.ticket-detail-section {
  padding-bottom: 25px;
  margin-bottom: 25px;

  border-bottom: 1px solid #eaedf1;
}

.ticket-detail-section:last-child {
  margin-bottom: 0;

  border-bottom: 0;
}

.detail-section-header {
  margin-bottom: 15px;
}

.detail-section-header h4 {
  margin: 4px 0 0;

  color: #2d3e52;

  font-size: 15px;
}

.detail-info-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 11px;
}

.detail-info-item {
  padding: 12px;

  border: 1px solid #e3e8ee;
  border-radius: 9px;

  background: #fafbfd;
}

.detail-info-item span {
  display: block;

  margin-bottom: 4px;

  color: #8693a3;

  font-size: 9px;
}

.detail-info-item strong {
  color: #35465a;

  font-size: 11px;
}

.ticket-description-box {
  padding: 14px;

  border: 1px solid #e4e9ef;
  border-radius: 9px;

  background: #f7f9fb;

  color: #47576a;

  font-size: 12px;
  line-height: 1.65;

  white-space: pre-wrap;
}

.detail-save-row {
  display: flex;
  justify-content: flex-end;

  margin-top: 14px;
}

.detail-side-card {
  padding-bottom: 20px;
  margin-bottom: 20px;

  border-bottom: 1px solid #e1e6eb;
}

.detail-side-card:last-child {
  margin-bottom: 0;

  border-bottom: 0;
}

.detail-side-card h4 {
  margin: 4px 0 14px;

  color: #314257;

  font-size: 14px;
}

.detail-side-description {
  color: #818e9d;

  font-size: 10px;
  line-height: 1.5;
}

.sla-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sla-detail > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sla-detail span {
  color: #8a96a4;

  font-size: 9px;
}

.sla-detail strong {
  color: #3b4b5e;

  font-size: 11px;
}

.sla-ok {
  color: var(--green) !important;
}

.sla-warning {
  color: var(--orange) !important;
}

.sla-expired {
  color: var(--red) !important;
}

/* ===================================================== */
/* TIMELINE */
/* ===================================================== */

.ticket-timeline {
  margin-bottom: 20px;
}

.timeline-item {
  position: relative;

  display: grid;

  grid-template-columns:
    18px
    minmax(0, 1fr);

  gap: 10px;

  padding-bottom: 17px;
}

.timeline-item::before {
  content: "";

  position: absolute;

  left: 4px;
  top: 14px;
  bottom: 0;

  width: 1px;

  background: #dae1e8;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 9px;
  height: 9px;

  margin-top: 4px;

  border-radius: 50%;

  background: var(--blue);
}

.timeline-content strong {
  display: block;

  color: #35465a;

  font-size: 11px;
}

.timeline-content p {
  margin: 4px 0;

  color: #59697c;

  font-size: 11px;
  line-height: 1.5;
}

.timeline-content small {
  color: #929daa;

  font-size: 9px;
}

.ticket-comment-box {
  padding: 15px;

  border: 1px solid #e3e8ed;
  border-radius: 10px;

  background: #f7f9fb;
}

.ticket-comment-box > label {
  display: block;

  margin-bottom: 7px;

  color: #536276;

  font-size: 11px;
  font-weight: 700;
}

.ticket-comment-box textarea {
  width: 100%;

  border: 1px solid #dce3ea;
  border-radius: 9px;

  padding: 10px;

  resize: vertical;

  outline: none;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  margin-top: 10px;
}

.comment-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;

  color: #687688;

  font-size: 10px;
}

/* ===================================================== */
/* EMPTY */
/* ===================================================== */

.empty {
  padding: 30px;

  color: var(--muted);

  text-align: center;

  font-size: 11px;
}

/* ===================================================== */
/* TOAST */
/* ===================================================== */

.toast {
  position: fixed;

  right: 22px;
  bottom: 22px;

  max-width: 360px;

  padding: 12px 16px;

  background: #17283d;
  color: #fff;

  border-radius: 10px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);

  font-size: 11px;

  opacity: 0;
  transform: translateY(15px);

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;

  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 1250px) {
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns:
      78px
      minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 10px;
  }

  .sidebar-company-logo {
    width: 48px;
    max-width: 48px;
  }

  .nav-item > span:not(.nav-icon) {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item b {
    display: none;
  }

  .ticket-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-grid-main {
    grid-template-columns: 1fr;
  }

  .ticket-detail-layout {
    grid-template-columns: 1fr;
  }

  .ticket-detail-main {
    border-right: 0;
  }

  .ticket-detail-sidebar {
    border-top: 1px solid #e6eaee;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;

    left: 0;
    right: 0;
    top: auto;
    bottom: 0;

    width: 100%;
    height: auto;

    padding: 7px;

    z-index: 100;
  }

  .logo-area,
  .sidebar-bottom {
    display: none;
  }

  .sidebar nav {
    display: grid;

    grid-template-columns: repeat(5, minmax(55px, 1fr));

    overflow-x: auto;
  }

  .nav-item {
    padding: 9px 6px;
  }

  .nav-item:nth-child(n + 6) {
    display: none;
  }

  .main {
    padding-bottom: 75px;
  }

  .topbar {
    padding: 14px 15px;
  }

  .topbar h2 {
    font-size: 16px;
  }

  .top-actions input {
    display: none;
  }

  .view {
    padding: 20px 14px 35px;
  }

  .dashboard-header,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header .btn,
  .section-header .btn {
    align-self: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-overlay {
    padding: 12px 8px;
  }
}

@media (max-width: 650px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid-secondary {
    grid-template-columns: 1fr;
  }

  .ticket-toolbar {
    grid-template-columns: 1fr;
  }

  .dashboard-alert {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .comment-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-header,
  .ticket-detail-header,
  .modal-body,
  .ticket-detail-main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ===================================================== */
/* BLOQUE 3 - GARANTÍAS / RMA */
/* ===================================================== */

.rma-kpis {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 18px;
}

.rma-toolbar {
  display: grid;

  grid-template-columns:
    minmax(280px, 1fr)
    220px
    210px;

  gap: 11px;

  margin-bottom: 16px;
}

.rma-toolbar input,
.rma-toolbar select {
  width: 100%;
  height: 42px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  padding: 0 12px;

  background: #ffffff;
  color: #344457;

  outline: none;
}

.rma-toolbar input:focus,
.rma-toolbar select:focus {
  border-color: #7caee4;
}

/* COBERTURA */

.coverage-badge {
  display: inline-flex;
  align-items: center;

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
}

.coverage-pending {
  background: #f1f4f7;
  color: #687688;
}

.coverage-approved {
  background: #e8f7ef;
  color: #167451;
}

.coverage-rejected {
  background: #ffecee;
  color: #ba3440;
}

/* ESTADOS RMA */

.rma-stage {
  display: inline-flex;
  align-items: center;

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
}

.rma-stage-request {
  background: #eaf3ff;
  color: #1762bd;
}

.rma-stage-evidence {
  background: #fff3dc;
  color: #9b6816;
}

.rma-stage-received {
  background: #eef5ff;
  color: #376da6;
}

.rma-stage-diagnosis {
  background: #f2efff;
  color: #6d54b8;
}

.rma-stage-approved {
  background: #e8f7ef;
  color: #167451;
}

.rma-stage-rejected {
  background: #ffecee;
  color: #ba3440;
}

.rma-stage-process {
  background: #fff0e4;
  color: #b55d10;
}

.rma-stage-closed {
  background: #edf1f4;
  color: #657386;
}

@media (max-width: 1000px) {
  .rma-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rma-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .rma-kpis {
    grid-template-columns: 1fr;
  }

  .rma-toolbar {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* FLUJO RMA */
/* ===================================================== */

.rma-process-wrapper {
  padding: 20px 24px;

  background: #fbfcfe;

  border-bottom: 1px solid #e7ebf0;
}

.rma-process-header {
  margin-bottom: 18px;
}

.rma-process-header h4 {
  margin: 4px 0 0;

  color: #314257;

  font-size: 14px;
}

.rma-process {
  display: flex;
  align-items: flex-start;

  width: 100%;

  overflow-x: auto;

  padding-bottom: 5px;
}

.rma-process-step {
  width: 90px;
  min-width: 90px;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 7px;

  text-align: center;

  position: relative;
}

.rma-process-circle {
  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  border: 2px solid #d9e1ea;

  background: #fff;
  color: #8b98a8;

  font-size: 10px;
  font-weight: 800;

  transition: all 0.2s ease;
}

.rma-process-step span {
  color: #8995a4;

  font-size: 9px;
  font-weight: 700;

  white-space: nowrap;
}

.rma-process-line {
  height: 2px;

  flex: 1;

  min-width: 25px;

  margin-top: 14px;

  background: #dfe5ec;
}

.rma-process-step.completed .rma-process-circle {
  background: #e8f7ef;

  border-color: #4a9a71;

  color: #24724d;
}

.rma-process-step.completed span {
  color: #477a5e;
}

.rma-process-step.active .rma-process-circle {
  background: #1565d8;

  border-color: #1565d8;

  color: #fff;

  box-shadow: 0 0 0 5px rgba(21, 101, 216, 0.08);
}

.rma-process-step.active span {
  color: #225f9f;
}

/* ===================================================== */
/* CHECKLIST */
/* ===================================================== */

.rma-section-help {
  margin: -7px 0 15px;

  color: #8491a1;

  font-size: 10px;
  line-height: 1.5;
}

.rma-checklist {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 10px;
}

.rma-check-item {
  display: flex;
  align-items: flex-start;

  gap: 10px;

  padding: 12px;

  border: 1px solid #e3e8ee;
  border-radius: 10px;

  background: #fafbfd;

  cursor: pointer;

  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.rma-check-item:hover {
  border-color: #b9d1eb;

  background: #f7fbff;
}

.rma-check-item input {
  margin-top: 2px;

  accent-color: #1565d8;
}

.rma-check-item strong {
  display: block;

  margin-bottom: 3px;

  color: #405165;

  font-size: 11px;
}

.rma-check-item small {
  display: block;

  color: #8995a3;

  font-size: 9px;
  line-height: 1.45;
}

/* ===================================================== */
/* EVIDENCIAS */
/* ===================================================== */

.rma-evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
}

.rma-evidence-list {
  display: grid;

  gap: 9px;
}

.rma-evidence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  padding: 11px 12px;

  border: 1px solid #e3e8ee;
  border-radius: 9px;

  background: #fafbfd;
}

.rma-evidence-info {
  display: flex;
  align-items: center;

  gap: 10px;

  min-width: 0;
}

.rma-evidence-icon {
  width: 34px;
  height: 34px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 8px;

  background: #edf5ff;
  color: #2569ad;

  font-size: 13px;
}

.rma-evidence-info strong {
  display: block;

  max-width: 400px;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  color: #405166;

  font-size: 10px;
}

.rma-evidence-info small {
  display: block;

  margin-top: 2px;

  color: #8b97a6;

  font-size: 9px;
}

.rma-evidence-empty {
  padding: 18px;

  border: 1px dashed #d9e1e9;
  border-radius: 10px;

  color: #8c98a7;

  text-align: center;

  font-size: 10px;
}

@media (max-width: 700px) {
  .rma-checklist {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* BLOQUE 4 - EQUIPOS */
/* ===================================================== */

.device-kpis {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 18px;
}

.device-toolbar {
  display: grid;

  grid-template-columns:
    minmax(260px, 1fr)
    200px
    200px;

  gap: 11px;

  margin-bottom: 16px;
}

.device-toolbar input,
.device-toolbar select {
  width: 100%;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #fff;

  color: #344457;

  outline: none;
}

.device-toolbar input:focus,
.device-toolbar select:focus {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

@media (max-width: 1100px) {
  .device-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .device-toolbar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .device-kpis {
    grid-template-columns: 1fr;
  }

  .device-toolbar {
    grid-template-columns: 1fr;
  }

  .device-toolbar input {
    grid-column: auto;
  }
}

/* ===================================================== */
/* FICHA DEL EQUIPO */
/* ===================================================== */

.device-related-list {
  display: grid;
  gap: 9px;
}

.device-related-item {
  display: grid;

  grid-template-columns: 105px minmax(0, 1fr) auto;

  gap: 12px;

  align-items: center;

  padding: 12px 13px;

  border: 1px solid #e6ebf1;
  border-radius: 10px;

  background: #fafbfd;
}

.device-related-code {
  color: var(--blue);

  font-size: 11px;
  font-weight: 800;
}

.device-related-content strong {
  display: block;

  color: #344457;

  font-size: 11px;
}

.device-related-content small {
  display: block;

  margin-top: 3px;

  color: #8793a3;

  font-size: 10px;
}

.device-related-empty {
  padding: 15px;

  border: 1px dashed #dfe5ec;
  border-radius: 10px;

  color: #8793a3;

  font-size: 11px;

  text-align: center;
}

.device-status-detail {
  margin-top: 13px;
}

.device-status-detail .pill {
  font-size: 11px;

  padding: 6px 11px;
}

@media (max-width: 700px) {
  .device-related-item {
    grid-template-columns: 1fr;
  }
}

#deviceDetailModal .device-status-detail {
  margin-top: 18px;
}

#deviceDetailModal .device-status-detail .pill {
  min-height: 32px;
  padding: 7px 12px;

  font-size: 11px;
}

#deviceDetailModal .sla-detail {
  display: grid;
  gap: 14px;

  margin-top: 18px;
}

#deviceDetailModal .sla-detail > div {
  padding: 12px 0;

  border-bottom: 1px solid #edf1f5;
}

#deviceDetailModal .sla-detail > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

#deviceDetailModal .sla-detail span {
  display: block;

  margin-bottom: 6px;

  color: #7d8998;

  font-size: 11px;
}

#deviceDetailModal .sla-detail strong {
  display: block;

  color: #314257;

  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

/* ===================================================== */
/* EDICIÓN DE EQUIPO */
/* ===================================================== */

.device-edit-form {
  margin-top: 18px;

  padding-top: 18px;

  border-top: 1px solid #e6ebf1;
}

.device-edit-actions {
  display: flex;

  justify-content: flex-end;
  align-items: center;

  gap: 10px;

  margin-top: 18px;
}

@media (max-width: 650px) {
  .device-edit-actions {
    flex-direction: column-reverse;
  }

  .device-edit-actions .btn {
    width: 100%;
  }
}

/* ===================================================== */
/* BLOQUE 5 - CLIENTES */
/* ===================================================== */

.client-kpis {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 18px;
}

.client-toolbar {
  display: grid;

  grid-template-columns:
    minmax(260px, 1fr)
    220px;

  gap: 11px;

  margin-bottom: 16px;
}

.client-toolbar input,
.client-toolbar select {
  width: 100%;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #fff;

  color: #344457;

  outline: none;
}

.client-toolbar input:focus,
.client-toolbar select:focus {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

.client-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 15px;
}

.client-card {
  background: #fff;

  border: 1px solid var(--line);
  border-radius: 15px;

  padding: 18px;

  box-shadow: var(--shadow);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.client-card:hover {
  transform: translateY(-2px);

  border-color: #cddcf0;

  box-shadow: 0 14px 32px rgba(27, 50, 79, 0.1);
}

.client-card-head {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 12px;
}

.client-card-head h4 {
  margin: 0 0 5px;

  color: #26374b;

  font-size: 15px;
}

.client-card-head small {
  color: #8a96a5;

  font-size: 10px;
}

.client-card-stats {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 8px;

  margin-top: 17px;
}

.client-stat {
  padding: 11px 9px;

  background: #f8fafc;

  border: 1px solid #edf1f5;
  border-radius: 10px;

  text-align: center;
}

.client-stat span {
  display: block;

  color: #8591a1;

  font-size: 9px;
}

.client-stat strong {
  display: block;

  margin-top: 4px;

  color: #2f4054;

  font-size: 17px;
}

.client-card-footer {
  display: flex;

  justify-content: space-between;
  align-items: center;

  gap: 10px;

  margin-top: 16px;

  padding-top: 14px;

  border-top: 1px solid #edf1f5;
}

.client-card-footer small {
  color: #8b97a6;

  font-size: 9px;
}

@media (max-width: 1100px) {
  .client-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .client-kpis {
    grid-template-columns: 1fr;
  }

  .client-toolbar {
    grid-template-columns: 1fr;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* FICHA DEL CLIENTE */
/* ===================================================== */

.client-related-list {
  display: grid;
  gap: 9px;
}

.client-related-item {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 14px;

  align-items: center;

  padding: 13px 14px;

  border: 1px solid #e5eaf0;
  border-radius: 11px;

  background: #fafbfd;
}

.client-related-main {
  min-width: 0;
}

.client-related-main strong {
  display: block;

  color: #304156;

  font-size: 11px;
}

.client-related-main small {
  display: block;

  margin-top: 4px;

  color: #8793a3;

  font-size: 10px;

  line-height: 1.45;
}

.client-related-actions {
  display: flex;

  align-items: center;

  gap: 8px;
}

.client-related-empty {
  padding: 15px;

  border: 1px dashed #dfe5ec;
  border-radius: 10px;

  color: #8793a3;

  font-size: 11px;

  text-align: center;
}

.client-status-detail {
  margin-top: 17px;
}

@media (max-width: 700px) {
  .client-related-item {
    grid-template-columns: 1fr;
  }

  .client-related-actions {
    justify-content: flex-start;
  }
}

/* ===================================================== */
/* FICHA DEL CLIENTE - SIMETRÍA GENERAL */
/* ===================================================== */

#clientDetailModal .modal-card.modal-large {
  width: min(1180px, calc(100vw - 48px));
}

/* ===================================================== */
/* DISTRIBUCIÓN PRINCIPAL */
/* ===================================================== */

#clientDetailModal .ticket-detail-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    310px;

  gap: 0;

  align-items: stretch;
}

/* ===================================================== */
/* COLUMNA IZQUIERDA */
/* ===================================================== */

#clientDetailModal .ticket-detail-main {
  padding: 28px 30px;

  border-right: 1px solid #e5eaf0;
}

#clientDetailModal .ticket-detail-section {
  padding: 0 0 28px;
  margin: 0 0 28px;

  border-bottom: 1px solid #e5eaf0;
}

#clientDetailModal .ticket-detail-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;

  border-bottom: 0;
}

#clientDetailModal .detail-section-header {
  margin-bottom: 18px;
}

#clientDetailModal .detail-section-header h4 {
  margin: 6px 0 0;

  color: #293b50;

  font-size: 18px;
}

/* ===================================================== */
/* CARDS INTERNAS */
/* ===================================================== */

#clientDetailModal .client-related-list {
  display: grid;

  gap: 11px;
}

#clientDetailModal .client-related-item {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 18px;

  min-height: 88px;

  padding: 16px 18px;

  border: 1px solid #e3e9f0;
  border-radius: 12px;

  background: #fafbfd;
}

#clientDetailModal .client-related-main {
  min-width: 0;
}

#clientDetailModal .client-related-main strong {
  display: block;

  color: #304156;

  font-size: 12px;
  font-weight: 800;
}

#clientDetailModal .client-related-main small {
  display: block;

  margin-top: 6px;

  color: #8390a1;

  font-size: 10px;
  line-height: 1.5;
}

#clientDetailModal .client-related-actions {
  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 9px;
}

/* ===================================================== */
/* COLUMNA DERECHA */
/* ===================================================== */

#clientDetailModal .ticket-detail-side {
  padding: 28px 24px;

  background: #fafbfc;

  display: block;
}

#clientDetailModal .detail-side-card {
  padding: 0 0 24px;
  margin: 0 0 24px;

  border-bottom: 1px solid #e1e6eb;
}

#clientDetailModal .detail-side-card:last-child {
  padding-bottom: 0;
  margin-bottom: 0;

  border-bottom: 0;
}

#clientDetailModal .detail-side-card h4 {
  margin: 6px 0 18px;

  color: #314257;

  font-size: 15px;
}

/* ===================================================== */
/* RESUMEN */
/* ===================================================== */

#clientDetailModal .sla-detail {
  display: flex;

  flex-direction: column;

  gap: 16px;

  margin-top: 0;
}

#clientDetailModal .sla-detail > div {
  padding: 0;

  border: 0;
}

#clientDetailModal .sla-detail span {
  display: block;

  margin-bottom: 4px;

  color: #8290a1;

  font-size: 10px;
}

#clientDetailModal .sla-detail strong {
  display: block;

  color: #304156;

  font-size: 17px;
  font-weight: 800;
}

#clientDetailModal .client-status-detail {
  margin-top: 16px;
}

/* ===================================================== */
/* HEADER */
/* ===================================================== */

#clientDetailModal .modal-header {
  padding: 24px 30px;

  margin: 0;

  border-bottom: 1px solid #e5eaf0;
}

#clientDetailModal .modal-header h3 {
  margin: 6px 0;

  font-size: 25px;
}

#clientDetailModal .modal-header p {
  margin: 0;

  line-height: 1.5;
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 900px) {
  #clientDetailModal .ticket-detail-layout {
    grid-template-columns: 1fr;
  }

  #clientDetailModal .ticket-detail-main {
    border-right: 0;

    border-bottom: 1px solid #e5eaf0;
  }

  #clientDetailModal .ticket-detail-side {
    padding: 24px;

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 24px;
  }

  #clientDetailModal .detail-side-card {
    margin: 0;
    padding: 0;

    border-bottom: 0;
  }
}

@media (max-width: 650px) {
  #clientDetailModal .modal-card.modal-large {
    width: calc(100vw - 20px);
  }

  #clientDetailModal .modal-header,
  #clientDetailModal .ticket-detail-main,
  #clientDetailModal .ticket-detail-side {
    padding-left: 18px;
    padding-right: 18px;
  }

  #clientDetailModal .ticket-detail-side {
    grid-template-columns: 1fr;
  }

  #clientDetailModal .client-related-item {
    grid-template-columns: 1fr;

    min-height: 0;
  }

  #clientDetailModal .client-related-actions {
    justify-content: flex-start;
  }
}

/* ===================================================== */
/* CONSISTENCIA DEL CLIENTE */
/* ===================================================== */

.client-consistency-status {
  margin-top: 16px;
}

.client-consistency-ok {
  padding: 11px 12px;

  border: 1px solid #cfe8dc;
  border-radius: 10px;

  background: #f0faf5;

  color: #277354;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.client-consistency-warning {
  padding: 11px 12px;

  border: 1px solid #f0d8ac;
  border-radius: 10px;

  background: #fff8eb;

  color: #916215;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.client-consistency-list {
  display: grid;

  gap: 8px;

  margin-top: 12px;
}

.client-consistency-item {
  padding: 10px 11px;

  border: 1px solid #e7ebf0;
  border-radius: 9px;

  background: #fff;
}

.client-consistency-item strong {
  display: block;

  color: #344457;

  font-size: 10px;
}

.client-consistency-item small {
  display: block;

  margin-top: 4px;

  color: #8793a3;

  font-size: 9px;
  line-height: 1.5;
}

/* ===================================================== */
/* BLOQUE 6 - BASE TÉCNICA */
/* ===================================================== */

.knowledge-kpis {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 18px;
}

.knowledge-toolbar {
  display: grid;

  grid-template-columns:
    minmax(280px, 1fr)
    190px
    190px
    170px;

  gap: 11px;

  margin-bottom: 18px;
}

.knowledge-toolbar input,
.knowledge-toolbar select {
  width: 100%;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #fff;

  color: #344457;

  outline: none;
}

.knowledge-toolbar input:focus,
.knowledge-toolbar select:focus {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

.knowledge-card {
  display: flex;

  flex-direction: column;

  min-height: 220px;

  padding: 18px;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 15px;

  box-shadow: var(--shadow);
}

.knowledge-card-top {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 12px;
}

.knowledge-card h4 {
  margin: 9px 0 7px;

  color: #2c3d52;

  font-size: 15px;
}

.knowledge-card-description {
  margin: 0;

  color: #718096;

  font-size: 11px;
  line-height: 1.55;
}

.knowledge-meta {
  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin-top: 14px;
}

.knowledge-meta-item {
  padding: 5px 8px;

  border-radius: 20px;

  background: #f4f7fa;

  color: #6e7c8e;

  font-size: 9px;
  font-weight: 700;
}

.knowledge-card-footer {
  display: flex;

  justify-content: space-between;
  align-items: center;

  gap: 12px;

  margin-top: auto;
  padding-top: 16px;

  border-top: 1px solid #edf1f5;
}

.knowledge-card-footer small {
  color: #8995a4;

  font-size: 9px;
}

@media (max-width: 1100px) {
  .knowledge-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .knowledge-toolbar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .knowledge-kpis {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar input {
    grid-column: auto;
  }

  .knowledge-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* FICHA ARTÍCULO TÉCNICO */
/* ===================================================== */

#knowledgeDetailModal .modal-card.modal-large {
  width: min(1180px, calc(100vw - 48px));
}

#knowledgeDetailModal .ticket-detail-layout {
  grid-template-columns:
    minmax(0, 1fr)
    310px;
}

#knowledgeDetailModal .ticket-detail-main {
  padding: 28px 30px;
}

#knowledgeDetailModal .ticket-detail-side {
  padding: 28px 24px;

  background: #fafbfc;
}

.knowledge-detail-box {
  padding: 16px 17px;

  border: 1px solid #e4e9ef;
  border-radius: 11px;

  background: #fafbfd;

  color: #526174;

  font-size: 11px;
  line-height: 1.7;

  white-space: pre-line;
}

.knowledge-procedure-box {
  background: #f8fbff;

  border-color: #dce9f8;
}

.knowledge-solution-box {
  background: #f4faf7;

  border-color: #d8ebe1;
}

.knowledge-detail-models {
  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin-top: 16px;
}

.knowledge-detail-model {
  display: inline-flex;

  padding: 6px 9px;

  border-radius: 20px;

  background: var(--blue-soft);

  color: var(--blue);

  font-size: 9px;
  font-weight: 800;
}

.knowledge-detail-model-empty {
  color: #8895a5;

  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  #knowledgeDetailModal .ticket-detail-layout {
    grid-template-columns: 1fr;
  }

  #knowledgeDetailModal .ticket-detail-main {
    border-right: 0;

    border-bottom: 1px solid #e5eaf0;
  }

  #knowledgeDetailModal .ticket-detail-side {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 22px;
  }
}

@media (max-width: 650px) {
  #knowledgeDetailModal .modal-card.modal-large {
    width: calc(100vw - 20px);
  }

  #knowledgeDetailModal .ticket-detail-side {
    grid-template-columns: 1fr;
  }

  #knowledgeDetailModal .ticket-detail-main,
  #knowledgeDetailModal .ticket-detail-side {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* ===================================================== */
/* FORMULARIO BASE TÉCNICA */
/* ===================================================== */

#knowledgeFormModal .modal-card.modal-large {
  width: min(1040px, calc(100vw - 48px));
}

#knowledgeFormModal .modal-body {
  max-height: calc(100vh - 210px);

  overflow-y: auto;
}

#knowledgeFormModal .form-help {
  display: block;

  margin-top: 6px;

  color: #8a96a5;

  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 650px) {
  #knowledgeFormModal .modal-card.modal-large {
    width: calc(100vw - 20px);
  }
}

/* ===================================================== */
/* BASE TÉCNICA EN ATENCIONES */
/* ===================================================== */

.detail-section-description {
  margin: 6px 0 0;

  color: #8491a2;

  font-size: 10px;
  line-height: 1.5;
}

.ticket-knowledge-list {
  display: grid;

  gap: 10px;
}

.ticket-knowledge-item {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 16px;

  padding: 14px 16px;

  border: 1px solid #e2e8ef;
  border-radius: 11px;

  background: #fafbfd;

  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.ticket-knowledge-item:hover {
  border-color: #cfdded;

  background: #f8fbff;
}

.ticket-knowledge-main {
  min-width: 0;
}

.ticket-knowledge-main strong {
  display: block;

  color: #304156;

  font-size: 11px;
}

.ticket-knowledge-main small {
  display: block;

  margin-top: 5px;

  color: #8491a2;

  font-size: 9px;
  line-height: 1.5;
}

.ticket-knowledge-tags {
  display: flex;

  flex-wrap: wrap;

  gap: 6px;

  margin-top: 8px;
}

.ticket-knowledge-tag {
  display: inline-flex;

  padding: 4px 7px;

  border-radius: 20px;

  background: #edf5ff;

  color: #2766b5;

  font-size: 8px;
  font-weight: 800;
}

.ticket-knowledge-empty {
  padding: 15px;

  border: 1px dashed #dce3eb;
  border-radius: 10px;

  color: #8592a3;

  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 650px) {
  .ticket-knowledge-item {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* BLOQUE 7 - USUARIOS */
/* ===================================================== */

.user-kpis {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 18px;
}

.user-toolbar {
  display: grid;

  grid-template-columns:
    minmax(280px, 1fr)
    200px
    180px;

  gap: 11px;

  margin-bottom: 18px;
}

.user-toolbar input,
.user-toolbar select {
  width: 100%;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #fff;

  color: #344457;

  outline: none;
}

.user-toolbar input:focus,
.user-toolbar select:focus {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

.user-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 15px;
}

.user-card {
  display: flex;

  flex-direction: column;

  min-height: 230px;

  padding: 18px;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 15px;

  box-shadow: var(--shadow);
}

.user-card-head {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 12px;
}

.user-card-identity {
  display: flex;

  align-items: center;

  gap: 11px;
}

.user-avatar {
  width: 42px;
  height: 42px;

  flex-shrink: 0;

  display: grid;

  place-items: center;

  border-radius: 11px;

  background: var(--blue-soft);

  color: var(--blue);

  font-size: 12px;
  font-weight: 800;
}

.user-card h4 {
  margin: 0 0 4px;

  color: #2d3f54;

  font-size: 14px;
}

.user-card-role {
  color: #8490a0;

  font-size: 9px;
  font-weight: 700;
}

.user-card-stats {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 8px;

  margin-top: 17px;
}

.user-card-stat {
  padding: 11px;

  border: 1px solid #edf1f5;
  border-radius: 10px;

  background: #f8fafc;
}

.user-card-stat span {
  display: block;

  color: #8591a1;

  font-size: 9px;
}

.user-card-stat strong {
  display: block;

  margin-top: 5px;

  color: #304156;

  font-size: 15px;
}

.user-card-footer {
  display: flex;

  justify-content: space-between;
  align-items: center;

  gap: 10px;

  margin-top: auto;
  padding-top: 16px;

  border-top: 1px solid #edf1f5;
}

.user-card-footer small {
  color: #8995a4;

  font-size: 9px;
}

@media (max-width: 1100px) {
  .user-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .user-kpis {
    grid-template-columns: 1fr;
  }

  .user-toolbar {
    grid-template-columns: 1fr;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* FICHA DETALLE USUARIO */
/* ===================================================== */

#userDetailModal .modal-card.modal-large {
  width: min(1180px, calc(100vw - 48px));
}

#userDetailModal .ticket-detail-layout {
  grid-template-columns:
    minmax(0, 1fr)
    310px;
}

#userDetailModal .ticket-detail-main {
  padding: 28px 30px;
}

#userDetailModal .ticket-detail-side {
  padding: 28px 24px;

  background: #fafbfc;
}

.user-related-list {
  display: grid;

  gap: 10px;
}

.user-related-item {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 14px;

  padding: 14px 16px;

  border: 1px solid #e3e9f0;
  border-radius: 11px;

  background: #fafbfd;
}

.user-related-main strong {
  display: block;

  color: #304156;

  font-size: 11px;
}

.user-related-main small {
  display: block;

  margin-top: 5px;

  color: #8591a1;

  font-size: 9px;
  line-height: 1.5;
}

.user-permission-list {
  display: grid;

  gap: 8px;

  margin-top: 15px;
}

.user-permission-item {
  display: flex;

  align-items: center;

  gap: 8px;

  padding: 8px 10px;

  border-radius: 8px;

  background: #f4f7fa;

  color: #556579;

  font-size: 9px;
  font-weight: 700;
}

.user-permission-item::before {
  content: "✓";

  color: var(--green);

  font-weight: 800;
}

@media (max-width: 900px) {
  #userDetailModal .ticket-detail-layout {
    grid-template-columns: 1fr;
  }

  #userDetailModal .ticket-detail-main {
    border-right: 0;

    border-bottom: 1px solid #e5eaf0;
  }

  #userDetailModal .ticket-detail-side {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 22px;
  }
}

@media (max-width: 650px) {
  #userDetailModal .modal-card.modal-large {
    width: calc(100vw - 20px);
  }

  #userDetailModal .ticket-detail-side {
    grid-template-columns: 1fr;
  }

  #userDetailModal .user-related-item {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* FORMULARIO USUARIO */
/* ===================================================== */

#userFormModal .modal-card.modal-large {
  width: min(980px, calc(100vw - 48px));
}

#userFormModal .modal-body {
  max-height: calc(100vh - 210px);

  overflow-y: auto;
}

.user-permission-preview {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 9px;
}

.user-permission-preview-item {
  display: flex;

  align-items: center;

  gap: 8px;

  min-height: 40px;

  padding: 9px 11px;

  border: 1px solid #e5eaf0;
  border-radius: 9px;

  background: #fafbfd;

  color: #556579;

  font-size: 10px;
  font-weight: 700;
}

.user-permission-preview-item::before {
  content: "✓";

  color: var(--green);

  font-weight: 800;
}

@media (max-width: 650px) {
  #userFormModal .modal-card.modal-large {
    width: calc(100vw - 20px);
  }

  .user-permission-preview {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* AJUSTE VISUAL - USUARIO LOGUEADO EN SIDEBAR */
/* ===================================================== */

.sidebar-session-user {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;
  min-width: 0;
}

.sidebar-session-avatar {
  width: 44px;
  height: 44px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: #3b82f6;
  color: #ffffff;

  font-size: 14px;
  font-weight: 800;
}

.sidebar-session-meta {
  min-width: 0;
}

.sidebar-session-meta strong {
  display: block;

  color: #ffffff;

  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-session-meta small {
  display: block;

  margin-top: 4px;

  color: rgba(255, 255, 255, 0.72);

  font-size: 11px;
  line-height: 1.2;
}

.sidebar-logout-btn {
  width: 100%;
  max-width: 320px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto;

  padding: 0 18px;

  border: 0;
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;

  font-size: 13px;
  font-weight: 700;
  text-align: center;

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

.sidebar-session-card {
  display: grid;
  gap: 14px;

  width: 100%;

  margin-top: 18px;
  padding-top: 18px;

  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* ===================================================== */
/* ALCANCE DE ATENCIONES POR USUARIO */
/* ===================================================== */

.ticket-scope-notice {
  display: inline-flex;
  align-items: center;

  margin-top: 10px;
  padding: 7px 10px;

  border: 1px solid #d9e7f8;
  border-radius: 20px;

  background: #f2f7fd;
  color: #416b9c;

  font-size: 9px;
  font-weight: 700;
}

/* ===================================================== */
/* BLOQUE 8 - REPORTES */
/* ===================================================== */

.report-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;

  margin-bottom: 20px;
}

.report-filter-group {
  display: grid;
  gap: 6px;
}

.report-filter-group label {
  color: #718096;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.4px;
}

.report-filter-group select {
  min-width: 190px;
  height: 42px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 9px;

  background: #ffffff;
  color: #344457;

  outline: none;
}

.report-filter-group select:focus {
  border-color: #7caee4;
}

#view-reports .report-kpis {
  display: grid;

  grid-template-columns: repeat(5, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  #view-reports .report-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .report-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-filter-group select {
    width: 100%;
    min-width: 0;
  }

  #view-reports .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #view-reports .report-kpis {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* BLOQUE 8 - ANÁLISIS DE REPORTES */
/* ===================================================== */

.report-analysis-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 18px;

  margin-bottom: 18px;
}

.report-analysis-card {
  min-height: 330px;
}

.report-bars {
  display: grid;
  gap: 15px;

  margin-top: 24px;
}

.report-bar-item {
  display: grid;
  gap: 7px;
}

.report-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
}

.report-bar-header span {
  color: #526174;

  font-size: 11px;
  font-weight: 700;
}

.report-bar-header strong {
  color: #25364a;

  font-size: 11px;
}

.report-bar-track {
  width: 100%;
  height: 9px;

  overflow: hidden;

  border-radius: 20px;

  background: #edf1f6;
}

.report-bar-fill {
  height: 100%;

  border-radius: inherit;

  background: linear-gradient(90deg, #1565d8, #58a8ff);

  transition: width 0.25s ease;
}

.report-empty {
  padding: 35px 10px;

  color: #8a96a8;

  font-size: 11px;
  text-align: center;
}

/* ===================================================== */
/* RENDIMIENTO POR RESPONSABLE */
/* ===================================================== */

.report-technician-panel {
  margin-bottom: 20px;
}

.report-technician-list {
  display: grid;

  margin-top: 20px;
}

.report-technician-row {
  display: grid;

  grid-template-columns:
    minmax(180px, 1.5fr)
    repeat(4, minmax(85px, 0.7fr));

  align-items: center;

  gap: 12px;

  padding: 14px 4px;

  border-bottom: 1px solid #edf0f4;
}

.report-technician-row:last-child {
  border-bottom: 0;
}

.report-technician-user {
  display: flex;
  align-items: center;

  gap: 10px;
}

.report-technician-avatar {
  width: 34px;
  height: 34px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: #edf5ff;
  color: #1565d8;

  font-size: 10px;
  font-weight: 800;
}

.report-technician-user strong {
  display: block;

  color: #27384c;

  font-size: 11px;
}

.report-technician-user small {
  display: block;

  margin-top: 2px;

  color: #8793a3;

  font-size: 9px;
}

.report-technician-stat {
  display: grid;
  gap: 3px;
}

.report-technician-stat span {
  color: #8995a4;

  font-size: 9px;
}

.report-technician-stat strong {
  color: #344457;

  font-size: 13px;
}

@media (max-width: 950px) {
  .report-analysis-grid {
    grid-template-columns: 1fr;
  }

  .report-technician-row {
    grid-template-columns:
      minmax(170px, 1fr)
      repeat(2, minmax(75px, 0.5fr));
  }

  .report-technician-stat:nth-child(4),
  .report-technician-stat:nth-child(5) {
    display: none;
  }
}

@media (max-width: 560px) {
  .report-technician-row {
    grid-template-columns:
      minmax(150px, 1fr)
      70px;
  }

  .report-technician-stat:nth-child(n + 3) {
    display: none;
  }
}

/* ===================================================== */
/* BLOQUE 8K - REPORTES RMA */
/* ===================================================== */

.report-rma-section {
  margin-top: 22px;
}

.report-rma-header {
  margin-bottom: 16px;
}

.report-rma-header h3 {
  margin: 5px 0 6px;

  color: #1f3045;

  font-size: 19px;
}

.report-rma-header p {
  margin: 0;

  color: #7d8998;

  font-size: 11px;
  line-height: 1.5;
}

.report-rma-kpis {
  display: grid;

  grid-template-columns: repeat(6, minmax(0, 1fr));

  gap: 12px;

  margin-bottom: 18px;
}

.report-mini-kpi {
  min-height: 92px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding: 14px;

  border: 1px solid #e3e9f1;
  border-radius: 13px;

  background: #ffffff;

  box-shadow: 0 8px 24px rgba(27, 50, 79, 0.05);
}

.report-mini-kpi span {
  color: #748195;

  font-size: 10px;
  font-weight: 700;
}

.report-mini-kpi strong {
  color: #25364a;

  font-size: 22px;
}

@media (max-width: 1200px) {
  .report-rma-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .report-rma-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===================================================== */
/* BLOQUE 8L - SLA */
/* ===================================================== */

.report-sla-section {
  margin-top: 24px;
}

.report-sla-section .report-mini-kpi strong {
  font-size: 21px;
}

/* ===================================================== */
/* BLOQUE 8M - RESUMEN REGIONAL */
/* ===================================================== */

.report-country-section {
  margin-top: 24px;
}

.report-country-section .report-rma-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;
}

.report-country-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 14px;
}

.report-country-card {
  padding: 18px;

  border: 1px solid #e3e9f1;
  border-radius: 14px;

  background: #ffffff;

  box-shadow: 0 8px 24px rgba(27, 50, 79, 0.05);
}

.report-country-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 18px;
}

.report-country-card-head strong {
  color: #25364a;

  font-size: 14px;
}

.report-country-total {
  min-width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  padding: 0 8px;

  border-radius: 9px;

  background: #edf5ff;
  color: #1565d8;

  font-size: 11px;
  font-weight: 800;
}

.report-country-stats {
  display: grid;
  gap: 10px;
}

.report-country-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;

  padding-bottom: 9px;

  border-bottom: 1px solid #edf0f4;
}

.report-country-stat:last-child {
  padding-bottom: 0;

  border-bottom: 0;
}

.report-country-stat span {
  color: #7d8998;

  font-size: 10px;
}

.report-country-stat strong {
  color: #344457;

  font-size: 11px;
}

@media (max-width: 900px) {
  .report-country-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .report-country-section .report-rma-header {
    align-items: stretch;
    flex-direction: column;
  }

  #exportReportCsvBtn {
    width: 100%;
  }
}

/* ===================================================== */
/* REPORTES - JERARQUÍA VISUAL FINAL */
/* ===================================================== */

#view-reports {
  padding-bottom: 64px;
}

/* ===================================================== */
/* CONTENEDORES PRINCIPALES */
/* ===================================================== */

.report-block {
  position: relative;

  margin-top: 34px;
  padding: 26px;

  border: 1px solid #dfe7f0;
  border-radius: 18px;

  background: #f8fafc;

  box-shadow: none;
}

/*
 * Pequeña línea superior para que
 * cada gran bloque se distinga.
 */

.report-block::before {
  content: "";

  position: absolute;

  top: -1px;
  left: 24px;

  width: 54px;
  height: 3px;

  border-radius: 0 0 6px 6px;

  background: #1565d8;
}

.report-block + .report-block {
  margin-top: 32px;
}

/* ===================================================== */
/* CABECERA ATENCIONES */
/* ===================================================== */

.report-block-header {
  display: flex;
  align-items: center;

  gap: 13px;

  margin-bottom: 22px;
  padding-bottom: 18px;

  border-bottom: 1px solid #e2e8f0;
}

.report-block-icon {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: #eaf3ff;
  color: #1565d8;

  font-size: 16px;
  font-weight: 800;
}

.report-block-header h3 {
  margin: 3px 0 4px;

  color: #1f3045;

  font-size: 19px;
}

.report-block-header p {
  margin: 0;

  color: #7b899a;

  font-size: 11px;
  line-height: 1.5;
}

/* ===================================================== */
/* CABECERAS RMA / SLA / REGIONAL */
/* ===================================================== */

.report-block > .report-rma-header {
  margin-bottom: 22px;
  padding-bottom: 18px;

  border-bottom: 1px solid #e2e8f0;
}

.report-block > .report-rma-header h3 {
  margin: 4px 0 5px;

  color: #1f3045;

  font-size: 19px;
}

.report-block > .report-rma-header p {
  margin: 0;

  color: #7b899a;

  font-size: 11px;
  line-height: 1.5;
}

/* Eyebrow del bloque principal */

.report-block > .report-rma-header .panel-eyebrow {
  color: #1565d8;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 1.2px;
}

/* ===================================================== */
/* DIFERENCIACIÓN POR SECCIÓN */
/* ===================================================== */

.report-block-attentions::before {
  background: #1565d8;
}

.report-rma-section::before {
  background: #6d54b8;
}

.report-sla-section::before {
  background: #14865c;
}

.report-country-section::before {
  background: #c87512;
}

/* Color sutil de eyebrow según bloque */

.report-rma-section > .report-rma-header .panel-eyebrow {
  color: #6d54b8;
}

.report-sla-section > .report-rma-header .panel-eyebrow {
  color: #14865c;
}

.report-country-section > .report-rma-header .panel-eyebrow {
  color: #c87512;
}

/* ===================================================== */
/* GRILLAS DE ANÁLISIS */
/* ===================================================== */

.report-block .report-analysis-grid {
  gap: 16px;

  margin-bottom: 18px;
}

/*
 * Los paneles internos ya no necesitan
 * una sombra fuerte porque están dentro
 * de un bloque principal.
 */

.report-block .report-analysis-card,
.report-block .report-technician-panel {
  background: #ffffff;

  border: 1px solid #e3e9f1;

  box-shadow: none;
}

/*
 * Quitamos altura artificial.
 * La tarjeta crece según su contenido.
 */

.report-block .report-analysis-card {
  min-height: 0;
}

/* Más respiración interna */

.report-block .report-analysis-card {
  padding: 20px;
}

/* ===================================================== */
/* RESPONSABLES */
/* ===================================================== */

.report-block-attentions .report-technician-panel {
  margin-top: 0;
  margin-bottom: 0;

  padding: 20px;
}

/* ===================================================== */
/* MINI KPI RMA / SLA */
/* ===================================================== */

.report-block .report-rma-kpis {
  gap: 12px;

  margin-bottom: 18px;
}

.report-block .report-mini-kpi {
  min-height: 88px;

  background: #ffffff;

  border: 1px solid #e3e9f1;

  box-shadow: none;
}

.report-block .report-mini-kpi:hover {
  border-color: #cedaea;
}

/* ===================================================== */
/* REGIONAL */
/* ===================================================== */

.report-country-section .report-country-grid {
  gap: 14px;
}

.report-country-section .report-country-card {
  background: #ffffff;

  border: 1px solid #e3e9f1;

  box-shadow: none;
}

/* ===================================================== */
/* CABECERA REGIONAL + BOTÓN */
/* ===================================================== */

.report-country-section > .report-rma-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.report-country-section #exportReportCsvBtn {
  flex-shrink: 0;
}

/* ===================================================== */
/* BARRAS */
/* ===================================================== */

.report-block .report-bars {
  margin-top: 22px;
}

/* ===================================================== */
/* ESPACIADO DEL RESUMEN SUPERIOR */
/* ===================================================== */

#view-reports .report-kpis {
  margin-bottom: 0;
}

/*
 * Primer bloque después de los KPI.
 */

#view-reports .report-kpis + .report-block {
  margin-top: 34px;
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 950px) {
  .report-block {
    padding: 22px;
  }
}

/* ===================================================== */
/* ATENCIONES */
/* ===================================================== */

.report-block-attentions .report-technician-panel {
  margin-bottom: 0;
}

/* ===================================================== */
/* RMA / SLA / REGIONAL */
/* ===================================================== */

.report-block.report-rma-section,
.report-block.report-sla-section,
.report-block.report-country-section {
  margin-top: 30px;
}

/*
 * Sus headers ahora funcionan
 * como encabezado principal del bloque.
 */

.report-block .report-rma-header {
  margin-bottom: 20px;
  padding-bottom: 17px;

  border-bottom: 1px solid #e4eaf1;
}

.report-block .report-rma-header h3 {
  font-size: 19px;
}

/* ===================================================== */
/* PANELES INTERNOS */
/* ===================================================== */

.report-block .report-analysis-card,
.report-block .report-technician-panel {
  background: #ffffff;

  border-color: #e5eaf0;

  box-shadow: 0 6px 18px rgba(27, 50, 79, 0.04);
}

/* ===================================================== */
/* KPIS INTERNOS */
/* ===================================================== */

.report-block .report-mini-kpi {
  background: #ffffff;

  border-color: #e4eaf1;

  box-shadow: 0 5px 15px rgba(27, 50, 79, 0.035);
}

@media (max-width: 760px) {
  .report-block {
    margin-top: 22px;
    padding: 18px;

    border-radius: 16px;
  }

  .report-block + .report-block {
    margin-top: 24px;
  }

  .report-block::before {
    left: 18px;
  }

  .report-block-header {
    align-items: flex-start;
    gap: 10px;
  }

  .report-block-icon {
    width: 34px;
    height: 34px;
  }

  .report-country-section > .report-rma-header {
    align-items: stretch;
    flex-direction: column;
  }

  #exportReportCsvBtn {
    width: 100%;
  }
}

/* ===================================================== */
/* BLOQUE 9 - CONFIGURACIÓN */
/* ===================================================== */

.settings-layout {
  display: grid;
  gap: 18px;
}

.settings-card {
  padding: 22px;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;

  gap: 13px;

  margin-bottom: 22px;
  padding-bottom: 18px;

  border-bottom: 1px solid #e6ebf1;
}

.settings-card-icon {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: #edf5ff;
  color: #1565d8;

  font-size: 15px;
  font-weight: 800;
}

.settings-card-header h3 {
  margin: 4px 0 5px;

  color: #25364a;

  font-size: 17px;
}

.settings-card-header p {
  margin: 0;

  color: #7e8a9a;

  font-size: 11px;
  line-height: 1.5;
}

/* ===================================================== */
/* SLA */
/* ===================================================== */

.settings-sla-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 14px;
}

.settings-field {
  display: grid;

  gap: 8px;
}

.settings-field > span {
  color: #657386;

  font-size: 10px;
  font-weight: 700;
}

.settings-input-unit {
  height: 44px;

  display: flex;
  align-items: center;

  overflow: hidden;

  border: 1px solid #dfe5ec;
  border-radius: 10px;

  background: #ffffff;
}

.settings-input-unit:focus-within {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

.settings-input-unit input {
  width: 100%;
  height: 100%;

  min-width: 0;

  padding: 0 12px;

  border: 0;

  background: transparent;
  color: #26374b;

  outline: none;

  font-size: 12px;
  font-weight: 700;
}

.settings-input-unit small {
  align-self: stretch;

  display: flex;
  align-items: center;

  padding: 0 11px;

  border-left: 1px solid #e7ebf0;

  background: #f7f9fb;
  color: #8490a0;

  font-size: 9px;
}

/* ===================================================== */
/* NOTIFICACIONES */
/* ===================================================== */

.settings-toggle-list {
  display: grid;
}

.settings-toggle-row {
  min-height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 12px 2px;

  border-bottom: 1px solid #edf0f4;

  cursor: pointer;
}

.settings-toggle-row:last-child {
  border-bottom: 0;
}

.settings-toggle-row strong {
  display: block;

  color: #344457;

  font-size: 11px;
}

.settings-toggle-row small {
  display: block;

  margin-top: 4px;

  color: #8a96a5;

  font-size: 10px;
  line-height: 1.4;
}

.settings-toggle-row input {
  width: 18px;
  height: 18px;

  flex-shrink: 0;

  accent-color: #1565d8;

  cursor: pointer;
}

/* ===================================================== */
/* GUARDAR */
/* ===================================================== */

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 18px 20px;

  border: 1px solid #dfe7f0;
  border-radius: 14px;

  background: #ffffff;
}

.settings-actions strong,
.settings-actions small {
  display: block;
}

.settings-actions strong {
  color: #2c3d52;

  font-size: 11px;
}

.settings-actions small {
  margin-top: 4px;

  color: #8793a3;

  font-size: 9px;
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 950px) {
  .settings-sla-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .settings-card {
    padding: 18px;
  }

  .settings-sla-grid {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #saveSettingsBtn {
    width: 100%;
  }
}

#saveSettingsBtn:disabled {
  opacity: 0.55;

  cursor: not-allowed;
}

/* ===================================================== */
/* BLOQUE 9E - PREFERENCIAS Y RESPALDO */
/* ===================================================== */

.settings-general-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.settings-field select {
  width: 100%;
  height: 44px;

  padding: 0 12px;

  border: 1px solid #dfe5ec;
  border-radius: 10px;

  background: #ffffff;
  color: #344457;

  outline: none;
}

.settings-field select:focus {
  border-color: #7caee4;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.06);
}

@media (max-width: 650px) {
  .settings-general-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================== */
/* BLOQUE 10C - INTEGRIDAD DE DATOS */
/* ===================================================== */

.settings-integrity {
  display: grid;
  gap: 16px;
}

.settings-integrity-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.settings-integrity-summary strong,
.settings-integrity-summary small {
  display: block;
}

.settings-integrity-summary strong {
  color: #344457;

  font-size: 12px;
}

.settings-integrity-summary small {
  margin-top: 4px;

  color: #8793a3;

  font-size: 10px;
  line-height: 1.5;
}

.settings-integrity-list {
  display: grid;

  gap: 9px;
}

.settings-integrity-item {
  padding: 11px 12px;

  border: 1px solid #f0d8ac;
  border-radius: 10px;

  background: #fff8eb;
}

.settings-integrity-item strong {
  display: block;

  color: #805917;

  font-size: 10px;
}

.settings-integrity-item small {
  display: block;

  margin-top: 4px;

  color: #8c754d;

  font-size: 9px;
  line-height: 1.5;
}

.settings-integrity-ok {
  padding: 12px;

  border: 1px solid #cfe8dc;
  border-radius: 10px;

  background: #f0faf5;
  color: #277354;

  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 650px) {
  .settings-integrity-summary {
    align-items: stretch;

    flex-direction: column;
  }

  #checkDataIntegrityBtn {
    width: 100%;
  }
}

/* ===================================================== */
/* ACCIONES DE ADMINISTRADOR / ELIMINACIÓN */
/* ===================================================== */

.admin-danger-zone {
  border-color: #f1d3d6;
  background: #fffafb;
}

.admin-danger-zone .panel-eyebrow {
  color: var(--red);
}

.detail-side-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-side-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ===================================================== */
/* EQUIPOS - MISMA SIMETRÍA VISUAL QUE CLIENTES */
/* ===================================================== */

/* Columna izquierda */
#deviceDetailModal .ticket-detail-main {
  padding: 28px 30px;
  border-right: 1px solid #e5eaf0;
}

#deviceDetailModal .ticket-detail-section {
  padding: 0 0 28px;
  margin: 0 0 28px;
  border-bottom: 1px solid #e5eaf0;
}

#deviceDetailModal .ticket-detail-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

#deviceDetailModal .detail-section-header {
  margin-bottom: 18px;
}

#deviceDetailModal .detail-section-header h4 {
  margin: 6px 0 0;
  color: #293b50;
  font-size: 18px;
}

/* Columna derecha */
#deviceDetailModal .ticket-detail-side {
  padding: 28px 24px;
  background: #fafbfc;
  display: block;
}

#deviceDetailModal .detail-side-card {
  padding: 0 0 24px;
  margin: 0 0 24px;
  border-bottom: 1px solid #e1e6eb;
}

#deviceDetailModal .detail-side-card:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

/* Acciones: igual que Clientes */
#deviceDetailModal .ticket-detail-side-section {
  padding: 0;
  margin: 0;
  border: 0;
}

#deviceDetailModal .ticket-detail-side-section .detail-section-header {
  margin-bottom: 15px;
}

#deviceDetailModal .ticket-detail-side-section h4 {
  margin: 6px 0 18px;
  color: #314257;
  font-size: 15px;
}

#deviceDetailModal #deleteDeviceBtn {
  margin-top: 15px;
}

.rma-evidence-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rma-evidence-open,
.rma-evidence-remove {
  min-width: 65px;
  height: 24px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

/* ABRIR */
.rma-evidence-open {
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.rma-evidence-open:hover {
  background: #dbeafe;
}

/* ELIMINAR */
.rma-evidence-remove {
  border: 1px solid #dc2626;
  background: #fef2f2;
  color: #dc2626;
}

.rma-evidence-remove:hover {
  background: #fee2e2;
}

.client-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-country-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.client-country-flag {
  font-size: 0.95rem;
  line-height: 1;
}

/* ===================================================== */
/* CENTRO DE ALERTAS INTERNAS */
/* ===================================================== */

.notification-center {
  position: relative;
  flex: 0 0 auto;
}

/* BOTÓN CAMPANA */

.notification-btn {
  position: relative;

  width: 42px;
  height: 42px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #dfe6ef;
  border-radius: 10px;

  background: #ffffff;
  color: #32445c;

  font-size: 18px;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.notification-btn:hover {
  background: #f6f9fd;
  border-color: #cbd7e6;
}

.notification-btn:focus {
  outline: none;

  border-color: #8bbaf7;

  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.08);
}

/* CONTADOR */

.notification-badge {
  position: absolute;

  top: -6px;
  right: -6px;

  min-width: 19px;
  height: 19px;

  padding: 0 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid #ffffff;
  border-radius: 999px;

  background: #dc3545;
  color: #ffffff;

  font-size: 10px;
  font-weight: 800;

  line-height: 1;
}

/* PANEL */

.notification-panel {
  position: absolute;

  top: calc(100% + 10px);
  right: 0;

  width: 390px;
  max-width: calc(100vw - 32px);

  background: #ffffff;

  border: 1px solid #e1e8f0;
  border-radius: 14px;

  box-shadow: 0 18px 45px rgba(31, 63, 104, 0.16);

  overflow: hidden;

  z-index: 1000;
}

.notification-panel.hidden {
  display: none;
}

/* CABECERA */

.notification-panel-header {
  padding: 16px 18px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  border-bottom: 1px solid #edf1f5;
}

.notification-panel-header > div {
  min-width: 0;
}

.notification-panel-header strong {
  display: block;

  color: #203650;

  font-size: 14px;
  font-weight: 800;
}

.notification-panel-header small {
  display: block;

  margin-top: 3px;

  color: #8290a3;

  font-size: 11px;
}

.notification-panel-header .text-btn {
  flex: 0 0 auto;

  padding: 0;

  border: 0;

  background: transparent;

  color: #246dc1;

  font-size: 11px;
  font-weight: 700;

  cursor: pointer;
}

.notification-panel-header .text-btn:hover {
  text-decoration: underline;
}

/* LISTADO */

.notification-list {
  max-height: 420px;

  overflow-y: auto;
}

/* ALERTA */

.notification-item {
  position: relative;

  padding: 15px 18px;

  display: flex;

  gap: 12px;

  border-bottom: 1px solid #edf1f5;

  background: #ffffff;

  cursor: pointer;

  transition: background 0.15s ease;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.unread {
  background: #f3f8ff;
}

/* INDICADOR */

.notification-item-indicator {
  flex: 0 0 auto;

  width: 9px;
  height: 9px;

  margin-top: 5px;

  border-radius: 50%;

  background: #1268d4;
}

.notification-item.warning .notification-item-indicator {
  background: #f59e0b;
}

.notification-item.critical .notification-item-indicator {
  background: #dc3545;
}

.notification-item.read .notification-item-indicator {
  background: #c8d1dc;
}

/* CONTENIDO */

.notification-item-content {
  min-width: 0;
  flex: 1;
}

.notification-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 10px;
}

.notification-item-title {
  color: #263d59;

  font-size: 13px;
  font-weight: 800;

  line-height: 1.35;
}

.notification-item-ticket {
  flex: 0 0 auto;

  color: #1268d4;

  font-size: 11px;
  font-weight: 800;
}

.notification-item-message {
  margin: 5px 0 0;

  color: #64758b;

  font-size: 12px;
  line-height: 1.45;
}

.notification-item-date {
  display: block;

  margin-top: 7px;

  color: #929fb0;

  font-size: 10px;
}

/* SIN ALERTAS */

.notification-empty {
  padding: 32px 20px;

  text-align: center;

  color: #8694a6;

  font-size: 12px;
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 700px) {
  .notification-panel {
    position: fixed;

    top: 76px;
    right: 14px;
    left: 14px;

    width: auto;
    max-width: none;
  }

  .notification-list {
    max-height: 60vh;
  }
}

.timeline-spaced {
  margin-top: 18px;
}
