
.sidebar-top {
  height: 90px;
  padding: 8px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.sidebar.collapsed {
  width: 70px;
}

.sidebar-nav {
  margin-top: 0;
  padding-top: 0;
}

.sidebar.collapsed #user-nombre,
.sidebar.collapsed #user-rol {
  display: none;
}

.sidebar.collapsed .sidebar-user button {
  font-size: 10px;
  padding: 2px 4px;
}
.sidebar-user {
  display: flex;
  justify-content: center;
  align-items: center;
}
.sidebar.collapsed .user-info {
  display: none;
}
.sidebar-user button:hover {
  background: #ffffff55;
  transform: scale(1.05);
}


  :root {
  --blue: #2F6BFF;
  --blue-dark: #1f4ed8;
  --blue-darker: #0B1F3A;

  --blue-light: #e8f0ff;
  --blue-mid: #c7d9ff;
  --blue-dim: rgba(47,107,255,0.12);
  --blue-glow: rgba(47,107,255,0.25);

  --white: #FFFFFF;

  --bg: #ffffff;
  --surface: #122845;
  --surface2: #1a3558;
  --surface3: #23406b;

  --border: #2a4365;
  --border2: #3b5b8a;

  --text: #ffffff;
  --text2: #334155;
  --text3: #ffffff;

  --green: #17a865;
  --green-dim: rgba(23,168,101,0.12);

  --red: #e03535;
  --red-dim: rgba(224,53,53,0.12);

  --orange: #e07820;
  --orange-dim: rgba(224,120,32,0.12);

  --purple: #6b4fd4;
  --purple-dim: rgba(107,79,212,0.12);

  --radius: 10px;

  --shadow: 0 2px 12px rgba(11,31,58,0.25);
  --shadow-md: 0 4px 24px rgba(11,31,58,0.35);
}
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    min-height: 100vh;
  }
  .app {
  display: flex;
  height: 100vh;
}

  /* SIDEBAR */
  .sidebar {
    width: 230px; min-width: 230px;
    background: var(--blue-darker);
    display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,112,206,0.2);
    position: sticky;
    top: 0;
    transition: width 0.25s ease;
    align-self: flex-start;
    min-height: calc(100vh - 40px);
    border-radius: 0 0 24px 0;
  }
.sidebar.collapsed {
  width: 70px;
  min-width: 70px;
}
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar.collapsed .sidebar-user .user-name,
.sidebar.collapsed .sidebar-user .user-role {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
}
.sidebar-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  right: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  z-index: 30;
}
  .sidebar-logo {
  padding: 56px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
  .sidebar-logo img { width: 100%; max-width: 170px; display: block; }
  .sidebar-nav { flex: 1; padding: 40px 0; overflow-y: auto; }
  .nav-section-label {
    font-size: 10px; color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: 2px;
    padding: 14px 18px 5px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; cursor: pointer;
    color: rgba(255,255,255,0.75); font-size: 13.5px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
  }
  .nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
  .nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff; border-left-color: #fff;
  }
  .nav-icon { font-size: 16px; width: 20px; text-align: center; }
  .sidebar-user {
    padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; gap: 10px;
  }
  .user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff; font-weight: 700;
  }
  .user-name { font-size: 13px; font-weight: 600; color: #fff; }
  .user-role { font-size: 11px; color: rgba(255,255,255,0.6); }

  /* MAIN */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 26px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow);
  }
  .topbar-title { font-size: 20px; font-weight: 700; color: var(--text); }
  .topbar-actions { display: flex; gap: 10px; }

  .btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius);
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; transition: all .15s;
  }
  .btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px var(--blue-glow); }
  .btn-primary:hover { background: var(--blue-dark); }
  .btn-secondary { background: var(--surface2); color: var(--text2); border: 1px solid var(--border2); }
  .btn-secondary:hover { background: var(--surface3); }
  .btn-ghost { background: transparent; color: var(--text2); }
  .btn-ghost:hover { background: var(--surface2); }
  .btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,53,53,0.25); }
  .btn-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(23,168,101,0.25); font-weight: 600; }

  .content {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

  /* STATS */
  .stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
  .stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow);
  }
  .stat-card.blue { border-top: 3px solid var(--blue); }
  .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 8px; font-weight: 600; }
  .stat-value { font-family: 'DM Mono', monospace; font-size: 30px; font-weight: 500; color: var(--blue); }
  .stat-sub { font-size: 12px; color: var(--text3); margin-top: 3px; }

  /* FILTER */
  .filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
  .search-wrap { position: relative; flex: 1; }
  .search-wrap input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    color: var(--text3); border-radius: var(--radius);
    padding: 9px 14px 9px 36px;
    font-family: 'Inter', sans-serif; font-size: 13px; outline: none; transition: border .15s;
  }
  .search-wrap input:focus { border-color: var(--blue); }
  .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); }
  .filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
}
  .filter-select:focus { border-color: var(--blue); }

  /* TABLE */
  .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  table { width: 100%; border-collapse: collapse; }
  thead th {
    background: var(--surface2); padding: 11px 16px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text3); font-weight: 700; text-align: left;
    border-bottom: 1px solid var(--border);
  }
  tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; cursor: pointer; }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--blue-light); }
  td { padding: 12px 16px; font-size: 13px; color: var(--text2); vertical-align: middle; }
  td.td-main { color: var(--text); font-weight: 600; }
  td.td-mono { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--blue); font-weight: 500; }

  /* BADGES */
  .badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  }
  .badge-dot { width: 5px; height: 5px; border-radius: 50%; }
  .badge-recibido { background: var(--blue-dim); color: var(--blue); }
  .badge-recibido .badge-dot { background: var(--blue); }
  .badge-diagnostico { background: var(--orange-dim); color: var(--orange); }
  .badge-diagnostico .badge-dot { background: var(--orange); }
  .badge-aprobado { background: var(--purple-dim); color: var(--purple); }
  .badge-aprobado .badge-dot { background: var(--purple); }
  .badge-proceso { background: rgba(0,112,206,0.08); color: var(--blue-dark); }
  .badge-proceso .badge-dot { background: var(--blue-dark); }
  .badge-listo { background: var(--green-dim); color: var(--green); }
  .badge-listo .badge-dot { background: var(--green); }
  .badge-entregado { background: rgba(120,140,160,0.12); color: #6a8099; }
  .badge-entregado .badge-dot { background: #6a8099; }

  /* MODAL */
  .overlay {
    position: fixed; inset: 0;
    background: rgba(0,30,60,0.5); backdrop-filter: blur(4px);
    z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
  }
  .overlay.open { display: flex; }
  .modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; width: 100%; max-width: 740px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,80,160,0.2);
    animation: slideUp .2s ease;
  }
  .modal-lg { max-width: 920px; }
  @keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
  .modal-header {
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface2);
  }
  .modal-header-logo { height: 28px; }
  .modal-title { font-size: 18px; font-weight: 700; color: var(--text); }
  .modal-close {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text2); font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all .15s;
  }
  .modal-close:hover { background: var(--red-dim); color: var(--red); }
  .modal-body { padding: 22px 24px; }
  .modal-footer {
    padding: 14px 24px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
    background: var(--surface2);
  }

  /* FORM */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
  .form-full { grid-column: 1 / -1; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); font-weight: 700; }
  .form-input, .form-textarea, .form-select {
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px;
    padding: 9px 12px; font-family: 'Inter', sans-serif; font-size: 13px;
    outline: none; transition: border .15s; width: 100%;
  }
  .form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
  .form-textarea { resize: vertical; min-height: 75px; }
  .form-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
  .section-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
    color: var(--blue); font-weight: 700; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
  }
  .section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .form-input,
 .form-select,
 .form-textarea {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.18);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255,255,255,0.65);
}
.total-row {
  background: rgba(255,255,255,0.08);
}
  /* ITEMS TABLE */
  .items-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
  .items-table th {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text3); padding: 7px 10px; text-align: left;
    border-bottom: 1px solid var(--border); background: var(--surface2);
  }
  .items-table td { padding: 5px 8px; }
  .items-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
  .item-input {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px;
    padding: 6px 8px; font-size: 13px; width: 100%;
    font-family: 'Inter', sans-serif; outline: none;
  }
  .item-input:focus { border-color: var(--blue); }
  .total-row { background: var(--blue-light); }
  .total-row td { font-weight: 700; color: var(--blue); font-family: 'DM Mono', monospace; padding: 10px; }
  .item-input {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px;
}
.item-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.items-table tr {
  background: transparent !important;
}
.btn-secondary {
  color: #fff; /* antes estaba muy transparente */
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
}
.btn-secondary:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255,255,255,0.05);
}
  /* DETAIL */
  .detail-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
  .detail-id { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--blue); margin-bottom: 4px; font-weight: 600; }
  .detail-instrument { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
  .detail-client { font-size: 13px; color: var(--text2); }
  .info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
  .info-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
  .info-card-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 4px; font-weight: 700; }
  .info-card-value { font-size: 14px; color: var(--text); font-weight: 600; }

  /* TABS */
  .tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
  .tab {
    padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
    color: var(--text3); border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all .15s;
  }
  .tab:hover { color: var(--blue); }
  .tab.active { color: var(--blue); border-bottom-color: var(--blue); }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  /* TIMELINE */
  .timeline { position: relative; padding-left: 18px; margin-bottom: 20px; }
  .timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
  .tl-item { position: relative; padding: 0 0 16px 18px; }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-dot {
    position: absolute; left: -18px; top: 3px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--border); z-index: 1;
  }
  .tl-dot.active { border-color: var(--blue); background: var(--blue); }
  .tl-dot.done { border-color: var(--green); background: var(--green); }
  .tl-label { font-size: 13px; font-weight: 600; color: var(--text); }
  .tl-date { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: 'DM Mono', monospace; }
  .tl-note { font-size: 12px; color: var(--text2); margin-top: 4px; background: var(--surface2); padding: 7px 10px; border-radius: 6px; border-left: 3px solid var(--blue); }

  .timeline p,
  .timeline div,
  .timeline-note {
  color: #ffffff !important;
  opacity: 1 !important;
}
  /* SIGNATURE */
  .sig-wrap {
    background: var(--surface2); border: 2px dashed var(--border2);
    border-radius: var(--radius); overflow: hidden;
  }
  .sig-wrap.has-sig { border-color: var(--green); border-style: solid; }
  .sig-canvas { display: block; cursor: crosshair; touch-action: none; }
  .sig-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
  .sig-hint { font-size: 12px; color: var(--text3); flex: 1; }
  .sig-signed-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--green-dim); color: var(--green);
    border: 1px solid rgba(23,168,101,0.3); border-radius: 20px;
    padding: 5px 14px; font-size: 12px; font-weight: 700;
  }

  /* PROGRESS */
  .progress-track { background: var(--surface2); border-radius: 20px; height: 7px; margin: 10px 0; overflow: hidden; border: 1px solid var(--border); }
  .progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #40a0ff); border-radius: 20px; transition: width .5s; }

  /* PORTAL */
  .portal-wrap { max-width: 700px; margin: 0 auto; }
  .portal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow); }
  .portal-card-header { padding: 18px 22px; background: var(--blue); }
  .portal-card-header .portal-logo { height: 32px; }
  .portal-card-body { padding: 22px; }
  /* PORTAL PUBLICO AJUSTES */
   .portal-wrap {
    max-width: 760px;
    width: 100%;
    margin: 20px auto;
    padding: 20px;
   }

   .portal-card {
    max-height: none;
    overflow: visible;
   }

   .portal-card-body {
    max-height: none;
    overflow: visible;
    padding-bottom: 40px;
   }
   .back-btn-seeksei{
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.portal-back-wrap {
  max-width: 700px;
  margin: 0 0 12px 0;
}

#app,
.main,
.content,
.view {
    overflow-y: auto;
}

  /* LOADING */
  .loading { text-align: center; padding: 40px; color: var(--text3); font-size: 13px; }
  .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; margin-bottom: 10px; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .empty-state { text-align: center; padding: 50px 20px; color: var(--text3); }
  .empty-icon { font-size: 36px; margin-bottom: 10px; }
  .empty-text { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text2); }

  /* ALERT */
  .alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
  .alert-warning { background: rgba(224,120,32,0.1); border: 1px solid rgba(224,120,32,0.3); color: var(--orange); }
  .alert-info { background: var(--blue-dim); border: 1px solid rgba(0,112,206,0.25); color: var(--blue-dark); }

  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

 .sidebar-logo {
  padding: 12px;
  min-height: 82px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: all .25s ease;
}

.sidebar-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: white;
  padding: 4px;
  border-radius: 10px;
}

/* cuando el sidebar esté colapsado */
.sidebar.collapsed .sidebar-logo {
  min-height: 72px;
  padding: 10px;
}

.sidebar.collapsed .sidebar-logo img {
  max-width: 48px;
  max-height: 48px;
  padding: 5px;
  border-radius: 12px;
}
table td {
  color: #333;
}
.btn-ghost {
  color: rgba(255, 255, 255, 0.7);
  transition: 0.2s;
}

.btn-ghost:hover {
  color: #ff4d4d;
}
#search-input::placeholder {
  color: rgba(255,255,255,0.65);
  opacity: 1;
}
#view-finanzas {
  background: #f5f2e9;
}

#view-finanzas .stat-card.blue{
    background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 100%);
    border:1px solid rgba(96,165,250,.18);
    border-radius:24px;
    box-shadow:0 18px 40px rgba(15,23,42,.25);
    position:relative;
    overflow:hidden;
    transition:.25s ease;
}

#view-finanzas .stat-card.blue:hover{
    transform:translateY(-4px);
    box-shadow:0 24px 48px rgba(15,23,42,.32);
}

#view-finanzas .stat-card.blue::after{
    content:'';
    position:absolute;
    width:140px;
    height:140px;
    border-radius:50%;
    background:rgba(255,255,255,.06);
    top:-40px;
    right:-40px;
}

#view-finanzas .stat-card.blue .stat-label{
    color:rgba(255,255,255,.75);
    letter-spacing:.18em;
    font-size:11px;
    font-weight:700;
}

#view-finanzas .stat-card.blue .stat-value{
    color:#93c5fd;
    font-size:42px;
    font-weight:900;
    letter-spacing:-0.05em;
}

.finance-panel{
    background:#101f35;
    border:1px solid rgba(255,255,255,.08);
    border-radius:20px;
    box-shadow:0 18px 42px rgba(11,31,58,.22);
    overflow:hidden;
    margin:24px 0;
}

.panel-head{
    padding:20px 24px;
    border-bottom:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.02);
    backdrop-filter: blur(8px);
}

#view-finanzas .stat-card{
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

#view-finanzas .stat-card:hover{
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(37,99,235,.18);
}

#view-finanzas .stat-card::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:3px;
    background:linear-gradient(90deg,#2563eb,#60a5fa);
}

.panel-head h3{
    margin:0;
    color:#ffffff;
    font-size:18px;
    font-weight:700;
    letter-spacing:-0.02em;
}
.panel-head p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.55);
  font-size: 12px;
}

.finance-chart-wrap {
  height: 190px;
  padding: 10px 20px 18px;
}

.finance-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.finance-table-host table {
  width: 100%;
  border-collapse: collapse;
}

.finance-table-host th {
  background: #101f35;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.finance-table-host td {
  background: #f4f1e8;
  color: #243044;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(11,31,58,.08);
}

.finance-table-host tr:hover td {
  background: #ece8dc;
}

.finance-table-host td:last-child,
.finance-table-host th:last-child {
  text-align: left;
}

#finanzas-tendencia,
#finanzas-comparacion {
  color: rgba(255,255,255,.62) !important;
}
#finanzas-chart {
  display: block !important;
  width: 100% !important;
  height: 220px !important;
}
#view-finanzas .stat-card.blue {
  position: relative;
}

#view-finanzas .stat-mini-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
}

#view-finanzas .stat-mini-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.btn-exportar {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 10px;

  background: #ffffff;
  border: 1px solid rgba(11,31,58,0.15);

  color: #0b1f3a;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-exportar:hover {
  background: #f3f6fb;
  border-color: rgba(11,31,58,0.25);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}
#view-finanzas #finanzas-mes {
  color: #0b1f3a;
  background: #ffffff;
  border: 1px solid rgba(11,31,58,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

#view-finanzas #finanzas-mes::-webkit-calendar-picker-indicator {
  opacity: 0.65;
  cursor: pointer;
}
.seeksei-client-card {
  max-width: 760px;
  margin: 48px auto;
  border-radius: 22px;
  overflow: hidden;
  background: #0b1f3a;
  box-shadow: 0 24px 60px rgba(11,31,58,.26);
  border: 1px solid rgba(255,255,255,.08);
}

.portal-hero {
  padding: 34px 34px 30px;
  background:
    radial-gradient(circle at top right, rgba(91,124,255,.55), transparent 38%),
    linear-gradient(135deg, #315cff 0%, #2447d8 48%, #14244a 100%);
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-logo-box {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: rgba(11,31,58,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 38px rgba(0,0,0,.22);
  flex: 0 0 auto;
}

.portal-logo-box img {
  width: 92px;
  height: auto;
  display: block;
}

.portal-eyebrow {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.portal-hero h2 {
  margin: 0;
  color: #ffffff;
  font-size: 26px;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.portal-hero p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.5;
  max-width: 460px;
}

.seeksei-client-body {
  padding: 28px 34px 32px;
  background: linear-gradient(180deg, #101f35 0%, #0b1f3a 100%);
}

.portal-search-grid {
  gap: 16px;
  margin-bottom: 18px;
}

.seeksei-client-body .form-label {
  color: rgba(255,255,255,.72);
}

.seeksei-client-body .form-input {
  height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.13);
  color: #ffffff;
}

.seeksei-client-body .form-input::placeholder {
  color: rgba(255,255,255,.42);
}

.seeksei-search-btn {
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-search-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

@media (max-width: 720px) {
  .portal-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-logo-box {
    width: 92px;
    height: 92px;
  }

  .portal-logo-box img {
    width: 72px;
  }
}
.portal-card {
  animation: fadeIn .4s ease;
}

@keyframes fadeIn {
  from { opacity:0; transform: translateY(10px); }
  to { opacity:1; transform: translateY(0); }
}

.usuario-header{
    margin-left:auto;
    margin-right:18px;
    color:#ffffff;
    font-weight:600;
    display:flex;
    align-items:center;
    font-size:14px;
    background:rgba(255,255,255,0.08);
    padding:8px 14px;
    border-radius:12px;
    backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,0.08);
}

.user-icon{
    width:32px;
    height:32px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-right:10px;

    background:linear-gradient(135deg,#3b82f6,#06b6d4);

    color:white;
    font-size:14px;
    font-weight:700;

    box-shadow:
      0 0 12px rgba(59,130,246,0.45),
      0 4px 12px rgba(0,0,0,0.35);
}

.mensaje-bienvenida{
    margin:20px 25px 10px 25px;
    padding:18px 22px;
    border-radius:18px;
    background:linear-gradient(135deg,#0f172a,#1e3a8a);
    color:white;
    font-size:20px;
    font-weight:600;
    box-shadow:0 10px 30px rgba(0,0,0,0.18);
    animation:fadeIn .4s ease;
}

@keyframes fadeIn{
    from{
        opacity:0;
        transform:translateY(-10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.finance-grid{
    display:grid;
    grid-template-columns: 0.8fr 1.8fr;
    gap:22px;
    align-items:start;
    margin-top:22px;
}

.finance-chart-panel{
    height:100%;
}

.finance-chart-wrap{
    height:260px !important;
}

@media (max-width: 980px){
    .finance-grid{
        grid-template-columns:1fr;
    }
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(59,130,246,0.55);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-info strong {
  color: #fff;
  font-size: 14px;
}

.user-info span {
  color: #9fb3c8;
  font-size: 12px;
}

.user-info small {
  color: #38bdf8;
  font-size: 11px;
}

.btn-password {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.35);
  color: #dbeafe;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}

.btn-password:hover {
  background: rgba(59,130,246,0.28);
}
.usuario-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.modal-usuario {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-usuario.activo {
  display: flex;
}

.modal-usuario-card {
  width: 360px;
  background: linear-gradient(145deg,#0f172a,#020617);
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 22px;
  padding: 28px;
  text-align: center;
  color: #fff;
  box-shadow: 0 25px 70px rgba(0,0,0,0.55);
  position: relative;
}

.cerrar-modal {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 26px;
  cursor: pointer;
}

.modal-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 0 25px rgba(59,130,246,0.55);
}

#modal-correo {
  color: #94a3b8;
  margin: 6px 0;
}

#modal-cargo {
  display: inline-block;
  background: rgba(59,130,246,0.15);
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.modal-usuario-card input {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.25);
  background: #020617;
  color: #fff;
  outline: none;
}

.btn-guardar-password {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg,#2563eb,#06b6d4);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.avatar-img,
.header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(59,130,246,0.5);
  box-shadow: 0 0 12px rgba(59,130,246,0.45);
}

.avatar-upload {
  margin-top: 14px;
}

.avatar-upload input {
  width: 100%;
  color: #94a3b8;
}
.modal-usuario-card {
  width: 390px;
  padding: 34px 30px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(59,130,246,0.28), transparent 35%),
    linear-gradient(145deg, rgba(15,23,42,0.96), rgba(2,6,23,0.98));
}

.modal-usuario-card h3 {
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 26px;
}

.modal-usuario-card h4 {
  margin: 18px 0 12px;
  font-size: 15px;
  color: #e0f2fe;
}

.modal-usuario-card hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.45), transparent);
  margin: 20px 0;
}

.avatar-upload {
  margin-top: 18px;
  padding: 12px;
  border: 1px dashed rgba(56,189,248,0.35);
  border-radius: 14px;
  background: rgba(15,23,42,0.55);
}

.avatar-upload input {
  font-size: 12px;
}

.modal-usuario-card input[type="password"] {
  height: 46px;
  font-size: 14px;
  background: rgba(2,6,23,0.72);
  border: 1px solid rgba(148,163,184,0.22);
}

.btn-guardar-password {
  height: 48px;
  margin-top: 16px;
  font-size: 15px;
  box-shadow: 0 12px 28px rgba(37,99,235,0.32);
}
.avatar-upload-premium {
  margin: 22px 0;
}

.avatar-upload-premium input {
  display: none;
}

.btn-avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px dashed rgba(56,189,248,0.45);
  background: rgba(15,23,42,0.72);
  color: #dbeafe;
  font-weight: 700;
  cursor: pointer;
}

.btn-avatar-upload:hover {
  background: rgba(37,99,235,0.18);
  border-color: rgba(56,189,248,0.75);
}

.password-field {
  position: relative;
  width: 100%;
  margin-top: 12px;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  transition: 0.25s ease;
}

.toggle-password:hover {
  background: rgba(59,130,246,0.12);
  color: #ffffff;
}

.toggle-password i {
  font-size: 15px;
}
.toggle-password {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password i {
  font-size: 13px;
}

.toggle-password:hover {
  color: rgba(4, 115, 234, 0.75);
  transform: scale(1.05);
}
.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: .2s ease;
}

.toggle-password:hover {
  color: rgba(24, 49, 133, 0.8);
}

.toggle-password i {
  font-size: 15px;
}

/* ===== HISTORIAL DEL INSTRUMENTO PREMIUM ===== */

#view-historial,
.historial-view {
  padding: 24px;
}

#view-historial h2,
.historial-view h2 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  margin: 24px 0 18px;
  letter-spacing: -0.4px;
}

#view-historial h2::after,
.historial-view h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}

#view-historial table,
.historial-view table {
  background: rgba(255,255,255,0.82);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15,23,42,0.12);
}

#view-historial thead th,
.historial-view thead th {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #ffffff;
  padding: 15px 18px;
  font-size: 12px;
  letter-spacing: 1px;
}

#view-historial tbody td,
.historial-view tbody td {
  padding: 16px 18px;
  color: #334155;
  font-size: 14px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
}

#view-historial tbody tr:hover,
.historial-view tbody tr:hover {
  background: rgba(37,99,235,0.06);
}

#view-historial tbody tr:last-child td,
.historial-view tbody tr:last-child td {
  border-bottom: none;
}
.print-orden-numero {
  margin: 20px auto 18px;
  padding: 10px 18px;
  width: fit-content;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  text-align: center;
}

@media print {
  .print-orden-numero {
    background: #0f172a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
@media print {
  body {
    background: #ffffff !important;
  }

  .btn-imprimir,
  button {
    display: none !important;
  }

  .print-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    color: #111827;
    font-family: Arial, sans-serif;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }

  th {
    background: #e5e7eb !important;
    color: #1f2937 !important;
    font-weight: 800;
  }

  td, th {
    border: 1px solid #d1d5db;
    padding: 10px;
  }
}
.tech-orders-link{
  cursor:pointer;
  color:#2563eb;
  font-weight:700;
  transition:.2s;
}

.tech-orders-link:hover{
  color:#1d4ed8;
  text-decoration:underline;
}
#view-dashboard,
#view-clientes,
#view-tecnicos,
#view-finanzas,
#view-historial,
#view-ordenes {
  display: none;
}

#view-dashboard.active,
#view-clientes.active,
#view-tecnicos.active,
#view-finanzas.active,
#view-historial.active,
#view-ordenes.active {
  display: block;
}
#view-dashboard,
#view-clientes,
#view-tecnicos,
#view-finanzas,
#view-historial,
#view-ordenes {
  display: none;
}

#view-dashboard.active,
#view-clientes.active,
#view-tecnicos.active,
#view-finanzas.active,
#view-historial.active,
#view-ordenes.active {
  display: block;
}
/* =========================
   COTIZACIONES
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 24px;
}

.modal.large-modal {
  width: min(1100px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #0f172a;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.modal-header h2 {
  margin: 0;
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 18px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.cotizacion-item {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.cotizacion-view-item{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.cotizacion-view-item h3{
  margin-bottom: 15px;
  color: #fff;
}

.cotizacion-view-item p{
  margin-bottom: 8px;
  color: rgba(255,255,255,0.8);
}

.procesos-box{
  margin-top: 15px;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 10px;
}

.procesos-box pre{
  white-space: pre-wrap;
  color: #dcdcdc;
  font-family: inherit;
}

.grid-2{
  display:grid;
  grid-template-columns: repeat(2,1fr);
  gap:20px;
}

@media(max-width:768px){
  .grid-2{
    grid-template-columns:1fr;
  }
}
/* =========================
   ACTIONS PREMIUM
========================= */

.acciones {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-action {

  border: none;
  outline: none;

  padding: 10px 16px;

  border-radius: 12px;

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

  cursor: pointer;

  transition: all .2s ease;

  backdrop-filter: blur(10px);
}

/* VER */

.btn-view {

  background: rgba(255,255,255,.05);

  color: #cbd5e1;

  border: 1px solid rgba(255,255,255,.08);

}

.btn-view:hover {

  background: rgba(255,255,255,.12);

  transform: translateY(-2px);

}

/* EDITAR */

.btn-edit {

  background: linear-gradient(
    135deg,
    #4f46e5,
    #7c3aed
  );

  color: white;

  box-shadow:
    0 10px 25px rgba(124,58,237,.25);

}

.btn-edit:hover {

  transform: translateY(-2px);

  box-shadow:
    0 15px 30px rgba(124,58,237,.35);

}

/* ELIMINAR */

.btn-delete {

  background: rgba(239,68,68,.08);

  color: #ef4444;

  border: 1px solid rgba(239,68,68,.15);

}

.btn-delete:hover {

  background: rgba(239,68,68,.14);

  transform: translateY(-2px);

}

/* RESPONSIVE */

@media (max-width: 768px) {

  .acciones {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
  }

}
.btn-add-item{
  margin-top: 18px;
  background: linear-gradient(135deg,#5b6cff,#7c4dff);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow: 0 6px 20px rgba(91,108,255,.25);
}

.btn-add-item:hover{
  transform: translateY(-2px);
  opacity: .95;
}
.acciones-cell{
  text-align:right;
  position:relative;
}

.actions-menu{
  position:relative;
  display:inline-block;
}

.actions-trigger{
  background:linear-gradient(
    135deg,
    rgba(91,108,255,.95),
    rgba(124,77,255,.92)
  );

  color:#fff;
  border:none;
  padding:10px 18px;
  border-radius:16px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;

  box-shadow:
    0 10px 24px rgba(91,108,255,.25);

  transition:all .25s ease;
}

.actions-trigger:hover{
  transform:translateY(-2px);
  opacity:.96;
}

.actions-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:115%;
  min-width:180px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  box-shadow:0 20px 45px rgba(15,23,42,.18);
  padding:6px;
  z-index:9999;
}

.actions-dropdown.active{
  display:block;
}

.actions-dropdown button{
  width:100%;
  background:transparent;
  border:none;
  text-align:left;
  padding:11px 12px;
  border-radius:10px;
  font-size:13px;
  font-weight:600;
  color:#111827;
  cursor:pointer;
}

.actions-dropdown button:hover{
  background:#f3f4f6;
}

.actions-dropdown .danger{
  color:#dc2626;
}

.actions-dropdown .danger:hover{
  background:#fef2f2;
}
.actions-trigger{
  background: rgba(15,23,42,.92);
  color:#fff;
  border:1px solid rgba(255,255,255,.14);
  padding:9px 16px;
  border-radius:14px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(15,23,42,.18);
}

.actions-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:120%;
  min-width:190px;
  background:linear-gradient(
  145deg,
  rgba(20,28,48,.96),
  rgba(33,41,69,.94)
);
  border:1px solid rgba(124,92,255,.18);
  border-radius:16px;
  box-shadow:
  0 12px 30px rgba(76,92,255,.16),
  0 8px 20px rgba(0,0,0,.18);
  padding:8px;
  z-index:9999;
  backdrop-filter:blur(18px);
}

.actions-dropdown button{
  width:100%;
  background:transparent;
  border:none;
  text-align:left;
  padding:12px 13px;
  border-radius:11px;
  font-size:13px;
  font-weight:600;
  color:#e5e7eb;
  cursor:pointer;
}

.actions-dropdown button:hover{
  background:rgba(255,255,255,.08);
}

.actions-dropdown .danger{
  color:#fb7185;
}

.actions-dropdown .danger:hover{
  background:rgba(239,68,68,.12);
}
#tabla-cotizaciones table {
  width: 100%;
  table-layout: fixed;
}

#tabla-cotizaciones th,
#tabla-cotizaciones td {
  padding: 16px 18px;
  vertical-align: middle;
}

#tabla-cotizaciones th:nth-child(1),
#tabla-cotizaciones td:nth-child(1) {
  width: 22%;
}

#tabla-cotizaciones th:nth-child(2),
#tabla-cotizaciones td:nth-child(2) {
  width: 22%;
}

#tabla-cotizaciones th:nth-child(3),
#tabla-cotizaciones td:nth-child(3) {
  width: 14%;
  text-align: center;
}

#tabla-cotizaciones th:nth-child(4),
#tabla-cotizaciones td:nth-child(4) {
  width: 14%;
  text-align: center;
}

#tabla-cotizaciones th:nth-child(5),
#tabla-cotizaciones td:nth-child(5) {
  width: 14%;
  text-align: center;
}

#tabla-cotizaciones th:nth-child(6),
#tabla-cotizaciones td:nth-child(6) {
  width: 14%;
  text-align: center;
}

.acciones-cell {
  text-align: center;
}

.actions-trigger {
  min-width: 110px;
}
/* =========================
   MODAL COTIZACIÓN PREMIUM
========================= */

#modal-cotizacion .modal{
  background: linear-gradient(145deg, #111827, #172033);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: visible;
}

#modal-cotizacion .modal{
  max-height: 92vh;
}

#modal-cotizacion .modal-body{
  max-height: calc(92vh - 140px);
  overflow-y: auto;
  padding-bottom: 90px;
}

#modal-cotizacion .modal-header{
  background: linear-gradient(135deg,#1e293b,#273554);
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

#modal-cotizacion .modal-header h2{
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

#modal-cotizacion .modal-body{
  padding: 28px;
}

#modal-cotizacion .form-grid,
#modal-cotizacion .grid-2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 22px;
}

#modal-cotizacion .form-group{
  display: flex;
  flex-direction: column;
  gap: 7px;
}

#modal-cotizacion label{
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 700;
}

#modal-cotizacion input,
#modal-cotizacion select,
#modal-cotizacion textarea{
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

#modal-cotizacion input::placeholder,
#modal-cotizacion textarea::placeholder{
  color: rgba(255,255,255,.45);
}

#modal-cotizacion input:focus,
#modal-cotizacion select:focus,
#modal-cotizacion textarea:focus{
  border-color: #2248f1;
  box-shadow: 0 0 0 4px rgba(124,77,255,.18);
}

#modal-cotizacion .section-title{
  margin: 24px 0 16px;
  color: #4968f2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#modal-cotizacion .cotizacion-item{
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 20px;
}

#modal-cotizacion textarea{
  min-height: 90px;
  resize: vertical;
}

#modal-cotizacion .modal-footer{
  background: rgba(15,23,42,.75);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 28px;
}
#modal-cotizacion .modal{
  max-height: 92vh;
  overflow-y: auto;
}

#modal-cotizacion .modal-body{
  max-height: calc(92vh - 140px);
  overflow-y: auto;
}

#modal-cotizacion .cotizacion-item{
  margin-bottom: 24px;
}
.preview-actions{
  display:flex;
  gap:12px;
  align-items:center;
}

.preview-actions .btn{
  min-width:150px;
}
.preview-modal{
  max-width: 980px;
}

.preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.preview-label{
  display:block;
  color:#2248f1;
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  margin-bottom:4px;
}

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

.preview-body{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.preview-summary{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}

.preview-summary div,
.preview-item,
.preview-totals{
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
}

.preview-summary div{
  padding:16px;
}

.preview-summary span,
.preview-item-grid span,
.preview-text-block span,
.preview-totals span{
  display:block;
  color:#93a4b8;
  font-size:12px;
  font-weight:700;
  margin-bottom:5px;
}

.preview-summary strong,
.preview-item-grid strong,
.preview-totals strong{
  color:#fff;
  font-size:15px;
}

.preview-section-title{
  color:#2248f1;
  font-size:12px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  border-top:1px solid rgba(255,255,255,.1);
  padding-top:18px;
}

.preview-item{
  padding:20px;
}

.preview-item-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:18px;
}

.preview-item-number{
  color:#2248f1;
  font-size:12px;
  font-weight:800;
}

.preview-item h3{
  color:#fff;
  font-size:20px;
  margin:4px 0 0;
}

.preview-item-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
  margin-bottom:18px;
}

.preview-text-block{
  background:rgba(15,23,42,.45);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
  padding:14px;
  margin-top:12px;
}

.preview-text-block p,
.preview-text-block pre{
  color:#f8fafc;
  font-size:13px;
  line-height:1.5;
  white-space:pre-wrap;
  margin:0;
  font-family:inherit;
}

.preview-totals{
  width:330px;
  margin-left:auto;
  padding:18px;
}

.preview-totals div{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}

.preview-total-final{
  border-top:1px solid rgba(255,255,255,.12);
  padding-top:12px;
  margin-top:12px;
}

.preview-total-final strong{
  font-size:22px;
  color:#fff;
}
/* ==============================
   TABLAS OPTIMIZADAS
============================== */

#tabla-clientes,
#tabla-clientes-institucionales,
#tabla-tecnicos,
#tabla-cotizaciones {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

#tabla-clientes table,
#tabla-clientes-institucionales table,
#tabla-tecnicos table,
#tabla-cotizaciones table {
  width: 100%;
  border-collapse: collapse;
}

#tabla-clientes thead th,
#tabla-clientes-institucionales thead th,
#tabla-tecnicos thead th,
#tabla-cotizaciones thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}
/* Compactar tablas */
#tabla-clientes th,
#tabla-clientes td,
#tabla-clientes-institucionales th,
#tabla-clientes-institucionales td,
#tabla-tecnicos th,
#tabla-tecnicos td,
#tabla-cotizaciones th,
#tabla-cotizaciones td {
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: middle;
}
/* PAGINACIÓN CLIENTES */
.paginacion-clientes{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:12px;
  padding:18px;
}

.paginacion-clientes button{
  background:#0B1F3A !important;
  color:#ffffff !important;
  border:none !important;
  border-radius:10px !important;
  padding:10px 16px !important;
  font-size:13px !important;
  font-weight:700 !important;
  cursor:pointer !important;
  opacity:1 !important;
}

.paginacion-clientes button:hover{
  background:#16345a !important;
}

.paginacion-clientes button:disabled{
  background:#cbd5e1 !important;
  color:#475569 !important;
  opacity:1 !important;
}

.paginacion-clientes span{
  color:#0B1F3A !important;
  font-weight:700;
  font-size:13px;
}
#paginacion-clientes {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#paginacion-clientes button {
 background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

#paginacion-clientes button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

#paginacion-clientes button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#paginacion-clientes span {
  color: #374151;
  font-weight: 600;
  font-size: 13px;
}
#paginacion-ordenes {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#paginacion-ordenes button {
 background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

#paginacion-ordenes button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

#paginacion-ordenes button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#paginacion-ordenes span {
  color: #374151;
  font-weight: 600;
  font-size: 13px;
}
#paginacion-ordenes {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#paginacion-ordenes button {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

#paginacion-ordenes button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

#paginacion-ordenes button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#paginacion-ordenes span {
  color: #374151;
  font-weight: 600;
  font-size: 13px;
}
.acciones-tabla {
  position: relative;
  text-align: center;
}

.btn-acciones {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #555;
}

.menu-acciones {
  position: absolute;
  top: 35px;
  right: 10px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
  z-index: 100;
}

.menu-acciones button {
  width: 100%;
  border: none;
  background: none;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.menu-acciones button:hover {
  background: #f5f5f5;
}
.content,
.main,
#view-clientes,
#view-clientes-institucionales,
#view-tecnicos,
#view-cotizaciones,
#tabla-clientes,
#tabla-clientes-institucionales,
#tabla-tecnicos,
#tabla-cotizaciones,
table,
tbody,
tr,
td {
  overflow: visible !important;
}

.acciones-tabla,
td:has(.menu-acciones),
td:has([id^="menu-cliente-"]),
td:has([id^="menu-tecnico-"]),
td:has([id^="menu-cotizacion-"]) {
  position: relative;
  overflow: visible !important;
}

.menu-acciones,
[id^="menu-cliente-"],
[id^="menu-tecnico-"],
[id^="menu-cotizacion-"] {
  z-index: 99999 !important;
}
#tabla-clientes-institucionales table {
  width: 100%;
  table-layout: auto;
}

#tabla-clientes-institucionales th,
#tabla-clientes-institucionales td {
  padding: 10px 12px;
  white-space: nowrap;
}

#tabla-clientes-institucionales th:nth-child(1),
#tabla-clientes-institucionales td:nth-child(1) {
  width: 18%;
}

#tabla-clientes-institucionales th:nth-child(2),
#tabla-clientes-institucionales td:nth-child(2) {
  width: 10%;
}

#tabla-clientes-institucionales th:nth-child(8),
#tabla-clientes-institucionales td:nth-child(8) {
  width: 70px;
  text-align: center;
}
/* =========================
   DASHBOARD PREMIUM LIMPIO
========================= */

#view-dashboard {
  padding: 22px 28px 14px;
  min-height: auto;
  background:
    radial-gradient(circle at top right, rgba(47,107,255,.14), transparent 34%),
    linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
}

#view-dashboard .mensaje-bienvenida {
  margin: 0 0 26px;
  padding: 22px 28px;
  border-radius: 22px;
  background:
    radial-gradient(circle at right, rgba(47,107,255,.45), transparent 35%),
    linear-gradient(135deg, #081a33, #13294b);
  box-shadow: 0 18px 40px rgba(11,31,58,.18);
}

#view-dashboard .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

#view-dashboard .stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 24px 26px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.25), transparent 36%),
    linear-gradient(145deg, #0B1F3A, #132a4a);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 38px rgba(11,31,58,.22);
  transition: .25s ease;
}

#view-dashboard .stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.11), transparent 42%);
  pointer-events: none;
}

#view-dashboard .stat-card::after {
  content: '';
  position: absolute;
  width: 145px;
  height: 145px;
  right: -45px;
  top: -45px;
  border-radius: 50%;
  background: rgba(59,130,246,.20);
}

#view-dashboard .stat-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 26px 52px rgba(11,31,58,.28);
}

#view-dashboard .stat-card > * {
  position: relative;
  z-index: 2;
}

#view-dashboard .stat-label {
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

#view-dashboard .stat-value {
  margin-top: 8px;
  color: #3B82F6;
  font-size: 42px;
  font-weight: 900;
  text-shadow: 0 0 18px rgba(59,130,246,.35);
}

#view-dashboard .stat-sub {
  margin-top: 4px;
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 600;
}

#view-dashboard .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

#view-dashboard .section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(15,23,42,.18);
}

#view-dashboard .dashboard-table-wrap {
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,255,.94));
  border: 1px solid rgba(15,23,42,.06);
  box-shadow:
    0 18px 42px rgba(15,23,42,.09),
    0 1px 2px rgba(15,23,42,.04);
}

#view-dashboard table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 0;
}

#view-dashboard thead th {
  padding: 16px 24px;
  background: linear-gradient(135deg, #0B1F3A, #142b4d);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-align: left;
}

#view-dashboard td {
  padding: 12px 20px;
  color: #111827;
  font-size: 14px;
  border-bottom: 1px solid rgba(15,23,42,.055);
}

#view-dashboard tbody tr {
  cursor: default;
  transition: background .18s ease;
}

#view-dashboard tbody tr:hover {
  background: rgba(59,130,246,.045);
}

#view-dashboard .orden-link {
  font-family: 'DM Mono', monospace;
  color: #2F6BFF;
  font-size: 13px;
  font-weight: 800;
}

#view-dashboard .cliente-cell {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-dashboard .estado-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:8px 14px;

  border-radius:999px;

  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;

  min-width:120px;

  box-shadow:
    0 6px 18px rgba(15,23,42,.08);

  border:1px solid transparent;
}
.estado-proceso{
  background:rgba(37,99,235,.12);
  color:#1d4ed8;
  border-color:rgba(37,99,235,.22);
}

.estado-entregado{
  background:rgba(16,185,129,.12);
  color:#059669;
  border-color:rgba(16,185,129,.20);
}

.estado-listo{
  background:rgba(124,58,237,.12);
  color:#4333ec;
  border-color:rgba(124,58,237,.20);
}

#view-dashboard .dashboard-actions {
  text-align: center;
}

#view-dashboard .btn-dashboard-action {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(47,107,255,.10);
  color: #2F6BFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s ease;
}

#view-dashboard .btn-dashboard-action:hover {
  background: #2F6BFF;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(47,107,255,.22);
}

#view-dashboard .btn-dashboard-action svg {
  width: 18px;
  height: 18px;
}

#view-dashboard th:nth-child(1),
#view-dashboard td:nth-child(1) {
  width: 18%;
}

#view-dashboard th:nth-child(2),
#view-dashboard td:nth-child(2) {
  width: 34%;
}

#view-dashboard th:nth-child(3),
#view-dashboard td:nth-child(3) {
  width: 24%;
  text-align: center;
}

#view-dashboard th:nth-child(4),
#view-dashboard td:nth-child(4) {
  width: 14%;
  text-align: center;
}
#view-dashboard .dashboard-table-wrap {
  margin-bottom: 0;
}

#view-dashboard table {
  margin-bottom: 0;
}

.main {
  overflow-y: auto;
}

.content {
  padding-bottom: 10px;
}
#view-dashboard th:nth-child(1),
#view-dashboard td:nth-child(1) {
  width: 16%;
}

#view-dashboard th:nth-child(2),
#view-dashboard td:nth-child(2) {
  width: 26%;
}

#view-dashboard th:nth-child(3),
#view-dashboard td:nth-child(3) {
  width: 26%;
}

#view-dashboard th:nth-child(4),
#view-dashboard td:nth-child(4) {
  width: 18%;
  text-align: center;
}

#view-dashboard th:nth-child(5),
#view-dashboard td:nth-child(5) {
  width: 14%;
  text-align: center;
}

#view-dashboard .instrumento-cell {
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.instrumento-cell{
  color:#475569;
  font-weight:600;
  font-size:13px;
}
.estado-recibido{ background:#e0f2fe; color:#0369a1; }
.estado-diagnostico{ background:#ffedd5; color:#c2410c; }
.estado-aprobacion{ background:#fef3c7; color:#b45309; }
.estado-proceso{ background:#dbeafe; color:#1d4ed8; }
.estado-listo{ background:#ccfbf1; color:#0f766e; }
.estado-entregado{ background:#dcfce7; color:#15803d; }

.estado-contable {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 12px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
}

.estado-pagado {
  background:#dcfce7;
  color:#15803d;
}

.estado-abonado {
  background:#dbeafe;
  color:#1d4ed8;
}

.estado-pendiente {
  background:#fef3c7;
  color:#b45309;
}