
   :root {
      --bg: #0b1220;
      --panel: #131d31;
      --panel-2: #18243a;
      --line: rgba(255,255,255,.08);
      --text: #eef4ff;
      --muted: #9eb0cf;
     --primary: #2fdc7a;
--primary-2: #18a957;
      --green: #24c46b;
      --yellow: #ffbd4a;
      --red: #ff7272;
      --radius: 22px;
      --shadow: 0 18px 40px rgba(0,0,0,.28);
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background:
      
        
        linear-gradient(180deg, #08111b 0%, #0b1220 100%);
      color: var(--text);
    }

    a { color: inherit; text-decoration: none; }

    .app {
      display: grid;
      grid-template-columns: 260px 1fr;
      min-height: 100vh;
    }

    .sidebar {
      background: rgba(9,15,26,.95);
      border-right: 1px solid var(--line);
      padding: 22px 18px;
      position: sticky;
      top: 0;
      height: 100vh;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 26px;
      padding: 6px 8px;
    }

    .brand img {
      max-width: 200px;
      height: auto;
      display: block;
    }

    .brand-text {
      display: none;
    }

    .logo {
      width: 46px;
      height: 46px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      font-weight: 900;
      color: #05131d;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      box-shadow: var(--shadow);
    }

    .brand h1 {
      margin: 0;
      font-size: 20px;
    }

    .brand p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .menu {
      display: grid;
      gap: 10px;
    }

    .menu a {
      padding: 13px 14px;
      border-radius: 16px;
      color: var(--muted);
      font-weight: 700;
      border: 1px solid transparent;
    }

    .menu a.active,
    .menu a:hover {
      background: rgba(255,255,255,.05);
      color: var(--text);
      border-color: var(--line);
    }

    .side-box {
      margin-top: 24px;
      padding: 18px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(31,209,106,.10), rgba(15,174,85,.09));
      border: 1px solid var(--line);
    }

    .side-box h3 {
      margin: 0 0 8px;
      font-size: 16px;
    }

    .side-box p {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.6;
    }

    .main {
      padding: 24px;
    }

    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 20px;
    }

    .header h2 {
      margin: 0;
      font-size: 30px;
      letter-spacing: -.8px;
    }

    .header p {
      margin: 6px 0 0;
      color: var(--muted);
    }

    .header-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .btn {
      min-height: 44px;
      padding: 0 16px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      border: 1px solid transparent;
    }

 
.btn-primary {
  background: linear-gradient(135deg, #34e685, #1fb866);
  color: #03210f;
    position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}


.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  transition: 0.5s;
}

.btn-primary:hover::after {
  left: 120%;
}



.btn-primary:hover {
  background: linear-gradient(135deg, #3dfc95, #22c96f);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}


    .btn-secondary {
      background: rgba(255,255,255,.05);
      color: var(--text);
      border-color: var(--line);
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 20px;
    }

    .stat {
      background: rgba(255,255,255,.05);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 20px;
      box-shadow: var(--shadow);
    }

    .stat small {
      display: block;
      color: var(--muted);
      margin-bottom: 10px;
      font-size: 13px;
    }

    .stat strong {
      display: block;
      font-size: 32px;
      margin-bottom: 6px;
    }

    .stat span {
      color: var(--muted);
      font-size: 13px;
    }

    .workspace {
      display: grid;
      grid-template-columns: 1.2fr .8fr;
      gap: 18px;
    }

    .panel {
      background: rgba(255,255,255,.05);
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .panel-head {
      padding: 18px 20px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .panel-head h3 {
      margin: 0;
      font-size: 20px;
    }

    .panel-head p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    .filters {
      padding: 16px 20px;
      border-bottom: 1px solid var(--line);
      display: grid;
      grid-template-columns: 1.2fr repeat(4, auto);
      gap: 10px;
      align-items: center;
    }

    .search,
    .select,
    .textarea {
      width: 100%;
      background: rgba(255,255,255,.05);
      border: 1px solid var(--line);
      color: var(--text);
      border-radius: 14px;
      padding: 12px 14px;
      outline: none;
    }

    .table-wrap {
      overflow-x: auto;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 880px;
    }

    th, td {
      padding: 14px 18px;
      text-align: left;
      border-bottom: 1px solid var(--line);
      vertical-align: top;
      font-size: 14px;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      letter-spacing: .3px;
      text-transform: uppercase;
      background: rgba(255,255,255,.02);
    }

    tr:hover td {
      background: rgba(255,255,255,.02);
    }

    .ticket-title {
      font-weight: 800;
      margin-bottom: 4px;
    }

    .ticket-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
    }

    .badge::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
    }

    .open { background: rgba(255,114,114,.18); color: #ff9393; }
    .progress { background: rgba(255,189,74,.18); color: #ffd076; }
    .closed { background: rgba(36,196,107,.18); color: #8be5b0; }
    .bot { background: rgba(100,180,255,.18); color: #9dd8ff; }
    .supervisor { background: rgba(155,89,182,.22); color: #c39bd3; }
    .area-supervision { background: rgba(155,89,182,.22); color: #c39bd3; }
    .area-servicio-tecnico { background: rgba(100,180,255,.18); color: #9dd8ff; }
    .area-administracion { background: rgba(255,189,74,.18); color: #ffd076; }
    .area-instalacion {background: rgba(236, 117, 220, 0.16); color: #ee60e2; border: 1px solid rgba(240, 67, 217, 0.32);}
    .row-instalacion td {border-left: 4px solid #f057e3;}



    .priority-high { color: #ff9e9e; font-weight: 800; }
    .priority-mid { color: #ffd88e; font-weight: 800; }
    .priority-low { color: #8de7b6; font-weight: 800; }

    .detail {
      padding: 20px;
      display: grid;
      gap: 18px;
    }

    .detail-card {
      background: rgba(255,255,255,.03);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 16px;
    }

    .detail-card h4 {
      margin: 0 0 12px;
      font-size: 15px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .detail-main {
      font-size: 22px;
      font-weight: 800;
      margin-bottom: 6px;
    }

    .detail-text {
      color: var(--muted);
      line-height: 1.65;
      font-size: 14px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .label {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 4px;
    }

    .value {
      font-weight: 700;
      font-size: 14px;
    }

    .timeline {
      display: grid;
      gap: 12px;
    }

    .timeline-item {
      padding-left: 14px;
      border-left: 2px solid rgba(31,209,106,.28);
    }

    .timeline-item strong {
      display: block;
      margin-bottom: 4px;
      font-size: 14px;
    }

    .reply-actions {
      display: grid;
      gap: 10px;
    }

    .reply-actions .btn { width: 100%; }

    @media (max-width: 1180px) {
      .stats, .workspace {
        grid-template-columns: 1fr;
      }
    }

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

      .sidebar {
        position: static;
        height: auto;
      }

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

    @media (max-width: 640px) {
      .main { padding: 16px; }
      .stats { grid-template-columns: 1fr 1fr; }
      .filters { grid-template-columns: 1fr; }
      .grid-2 { grid-template-columns: 1fr; }
    }

    select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select option {
  background: #0b1220;
  color: #fff;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: rgba(255,255,255,0.05);
  color: #fff;

  /* flechita custom */
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;

  padding-right: 40px; /* espacio para la flecha */
}
.header-actions span {
  font-weight: bold;
  margin-right: 10px;
}
.chat-ticket {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  background: #efeae2;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  overflow: hidden;
}

.chat-header {
  background: #f0f2f5;
  padding: 14px 18px;
  border-bottom: 1px solid #d9d9d9;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  color: #111b21;
}

.chat-meta {
  margin-top: 4px;
  font-size: 13px;
  color: #667781;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px;
  background-image: linear-gradient(rgba(255,255,255,0.03), rgba(255,255,255,0.03));
}

.chat-row {
  display: flex;
  margin-bottom: 12px;
}

.chat-row.msg-in {
  justify-content: flex-start;
}

.chat-row.msg-out {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 75%;
  padding: 8px 12px 6px;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  position: relative;
  word-wrap: break-word;
}

.msg-in .chat-bubble {
  background: #ffffff;
  border-top-left-radius: 4px;
}

.msg-out .chat-bubble {
  background: #d9fdd3;
  border-top-right-radius: 4px;
}

.chat-author {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #54656f;
}

.chat-text {
  font-size: 14px;
  line-height: 1.5;
  color: #111b21;
 
}

.chat-time {
  font-size: 11px;
  color: #667781;
  text-align: right;
  margin-top: 6px;
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #f0f2f5;
  border-top: 1px solid #d9d9d9;
}

.chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d1d7db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.chat-form button {
  border: 0;
  background: #00a884;
  color: #fff;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-form button:hover {
  background: #019270;
}

@media (max-width: 768px) {
  .chat-ticket {
    height: calc(100vh - 90px);
    border-radius: 0;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .chat-form {
    flex-direction: column;
  }

  .chat-form button {
    height: 42px;
  }
}
a,
button,
select,
.btn,
.menu a {
  cursor: pointer;
}

.btn,
.menu a,
.select,
.search,
.textarea {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.menu a:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}

.select:hover,
.search:hover,
.textarea:hover {
  border-color: rgba(255,255,255,.22);
}

.select:focus,
.search:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,143,61,.18);
}
select.select:hover {
  background-color: rgba(255,255,255,.08);
}
/* FILAS DE TICKETS SEGUN ESTADO */
.table-wrap table tbody tr.row-open td {
  background: rgba(255, 114, 114, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-open td:first-child {
  border-left: 4px solid #ff7272;
}

.table-wrap table tbody tr.row-progress td {
  background: rgba(255, 189, 74, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-progress td:first-child {
  border-left: 4px solid #ffbd4a;
}

.table-wrap table tbody tr.row-closed td {
  background: rgba(36, 196, 107, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-closed td:first-child {
  border-left: 4px solid #24c46b;
}

.table-wrap table tbody tr.row-bot td {
  background: rgba(100, 180, 255, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-bot td:first-child {
  border-left: 4px solid #9dd8ff;
}

/* Area-based row colors */
.table-wrap table tbody tr.row-supervision td {
  background: rgba(155, 89, 182, 0.12) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-supervision td:first-child {
  border-left: 4px solid #9b59b6;
}

.table-wrap table tbody tr.row-servicio-tecnico td {
  background: rgba(100, 180, 255, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-servicio-tecnico td:first-child {
  border-left: 4px solid #9dd8ff;
}

.table-wrap table tbody tr.row-administracion td {
  background: rgba(255, 189, 74, 0.10) !important;
  border-left: none;
}
.table-wrap table tbody tr.row-administracion td:first-child {
  border-left: 4px solid #ffbd4a;
}

.table-wrap table tbody tr.row-open:hover td {
  background: rgba(255, 114, 114, 0.16) !important;
}

.table-wrap table tbody tr.row-progress:hover td {
  background: rgba(255, 189, 74, 0.18) !important;
}

.table-wrap table tbody tr.row-closed:hover td {
  background: rgba(36, 196, 107, 0.18) !important;
}

.table-wrap table tbody tr.row-bot:hover td {
  background: rgba(100, 180, 255, 0.16) !important;
}

.table-wrap table tbody tr.row-supervision:hover td {
  background: rgba(155, 89, 182, 0.20) !important;
}

.table-wrap table tbody tr.row-servicio-tecnico:hover td {
  background: rgba(100, 180, 255, 0.16) !important;
}

.table-wrap table tbody tr.row-administracion:hover td {
  background: rgba(255, 189, 74, 0.18) !important;
}
.table-wrap table tbody tr.row-instalacion td {
  background: rgba(240, 67, 217, 0.205) !important;
  border-left: none;
}

.table-wrap table tbody tr.row-instalacion td:first-child {
  border-left: 4px solid #ff00ea;
}

.table-wrap table tbody tr.row-instalacion:hover td {
  background: rgba(240, 67, 217, 0.16) !important;
}

.mobile-ticket-card.row-instalacion {
  border-left: 4px solid #ff00ea;
  background: rgba(255, 153, 0, 0.08);
}

/* Mobile cards - area colors */
.mobile-ticket-card.row-supervision {
  border-left: 4px solid #9b59b6;
  background: rgba(155, 89, 182, 0.08);
}
.mobile-ticket-card.row-servicio-tecnico {
  border-left: 4px solid #9dd8ff;
  background: rgba(100, 180, 255, 0.08);
}
.mobile-ticket-card.row-administracion {
  border-left: 4px solid #ffbd4a;
  background: rgba(255, 189, 74, 0.08);
}
.mobile-ticket-card.row-infraestructura {
  border-left: 4px solid #40e0d0;
  background: rgba(255,255,255,.03);
}


/* Delete button */
.btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #e74c3c);
  color: #fff;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ff8080, #ef5350);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}

/* WhatsApp Message Status Checks */
.wa-status {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  vertical-align: middle;
}

.wa-status svg {
  width: 16px;
  height: 16px;
}

.wa-status.sent svg { color: #999; }
.wa-status.delivered svg { color: #999; }
.wa-status.read svg { color: #34b7f1; }
.wa-status.failed svg { color: #e74c3c; }

/* Unread Message Badge in List */
.unread-badge {
  background-color: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.ticket-timer {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}

.ticket-timer.time-ok {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.35);
}

.ticket-timer.time-warn {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
  border-color: rgba(241, 196, 15, 0.35);
}

.ticket-timer.time-danger {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.35);
}



.area-infraestructura {
  background: rgba(64, 224, 208, 0.18);
  color: #7ff7ea;
  border: 1px solid rgba(127, 247, 234, 0.28);
}

.table-wrap table tbody tr.row-infraestructura td {
  background: rgba(64, 224, 208, 0.10) !important;
  border-left: none;
}

.table-wrap table tbody tr.row-infraestructura td:first-child {
  border-left: 4px solid #40e0d0;
}

.table-wrap table tbody tr.row-infraestructura:hover td {
  background: rgba(64, 224, 208, 0.16) !important;
}
