/* ═══════════════════════════════════════════════════════════
   INORGE SAC · Portal Operativo
   Paleta: #0B3A66 azul · #B4231C rojo · grises corporativos
   ═══════════════════════════════════════════════════════════ */
:root {
  --azul:      #0B3A66;
  --azul-mid:  #1A5FA0;
  --azul-3:    #2563EB;
  --azul-bg:   #EBF3FC;
  --rojo:      #B4231C;
  --rojo-2:    #DC2626;
  --green:     #1D7A3D;
  --orange:    #D97706;
  --ink:       #0A1628;
  --body:      #374151;
  --muted:     #6B7280;
  --gray-1:    #F9FAFB;
  --gray-2:    #F3F4F6;
  --gray-3:    #E5E7EB;
  --gray-4:    #9CA3AF;
  --border:    #E2E8F0;
  --bg:        #F1F5F9;
  --white:     #FFFFFF;
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --cond:      'Barlow Condensed', sans-serif;
  --sans:      'Barlow', sans-serif;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(10,22,40,.07), 0 4px 14px rgba(10,22,40,.05);
  --shadow-lg: 0 8px 32px rgba(10,22,40,.13), 0 2px 8px rgba(10,22,40,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(11,58,102,.06) 0%, transparent 52%),
    radial-gradient(ellipse at 100% 100%, rgba(180,35,28,.04) 0%, transparent 45%),
    radial-gradient(rgba(11,58,102,.04) 1px, transparent 1px);
  background-size: 100%, 100%, 28px 28px;
  background-attachment: fixed, fixed, fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: var(--sans); }
img { max-width: 100%; display: block; }

/* ══ ANIMACIONES ══════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-20deg); }
  100% { transform: translateX(300%)  skewX(-20deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes staggerIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatGeo {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-10px) rotate(6deg); }
}
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,28,.3); }
  50%       { box-shadow: 0 0 0 8px rgba(180,35,28,0); }
}
@keyframes gradientSlide {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes progressFill {
  from { width: 0; }
}
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-layout  { display: flex; min-height: 100vh; }
.app-main    { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-content { flex: 1; padding: clamp(1.25rem, 3vw, 1.75rem); overflow-y: auto; animation: fadeInUp .35s ease; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, #071d36 0%, #061527 55%, #050f1e 100%);
  color: rgba(255,255,255,.6);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid rgba(255,255,255,.05);
  z-index: 100;
}

/* Orbs decorativos de fondo */
.sb-orb {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(40px); opacity: .18;
}
.sb-orb-1 {
  width: 180px; height: 180px; top: -40px; right: -60px;
  background: radial-gradient(circle, #1a5fa3, transparent);
  animation: sbOrbFloat 8s ease-in-out infinite;
}
.sb-orb-2 {
  width: 140px; height: 140px; bottom: 80px; left: -50px;
  background: radial-gradient(circle, #B4231C, transparent);
  animation: sbOrbFloat 11s ease-in-out infinite reverse;
}
@keyframes sbOrbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(16px) scale(1.08); }
}

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative; z-index: 1; flex-shrink: 0;
}
.sidebar-logo::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180,35,28,.7), rgba(26,95,163,.5), transparent);
}
.sidebar-logo a { color: inherit; text-decoration: none; display: block; }
.sb-tagline {
  display: block; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(255,255,255,.28); margin-top: 5px; font-family: var(--cond);
}

.sidebar-nav {
  display: flex; flex-direction: column; flex: 1; padding: 8px 10px 0;
  gap: 2px; position: relative; z-index: 1;
}
.sidebar-section {
  font-family: var(--cond); font-size: 9px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: rgba(180,35,28,.9); padding: 14px 6px 4px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-section span { flex-shrink: 0; }
.sidebar-section::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(180,35,28,.35), transparent);
}

/* ── Ítems de nav ─────────────────── */
.snav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 9px;
  color: rgba(255,255,255,.5); font-size: 13px; font-weight: 500;
  text-decoration: none; position: relative; overflow: hidden;
  border: 1px solid transparent;
  transition: color .22s, border-color .22s, background .22s;
  animation: snavIn .32s ease both;
}
@keyframes snavIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sidebar-nav .snav-item:nth-child(1)  { animation-delay: .04s; }
.sidebar-nav .snav-item:nth-child(2)  { animation-delay: .08s; }
.sidebar-nav .snav-item:nth-child(3)  { animation-delay: .12s; }
.sidebar-nav .snav-item:nth-child(4)  { animation-delay: .16s; }
.sidebar-nav .snav-item:nth-child(5)  { animation-delay: .20s; }
.sidebar-nav .snav-item:nth-child(6)  { animation-delay: .24s; }
.sidebar-nav .snav-item:nth-child(7)  { animation-delay: .28s; }
.sidebar-nav .snav-item:nth-child(8)  { animation-delay: .32s; }

/* Fondo hover (pseudo slide) */
.snav-item::before {
  content: ''; position: absolute; inset: 0; border-radius: 9px;
  background: linear-gradient(90deg, rgba(26,95,163,.2) 0%, rgba(26,95,163,.06) 100%);
  opacity: 0; transition: opacity .22s; pointer-events: none;
}
.snav-item:hover { color: #e8f4ff; border-color: rgba(255,255,255,.08); }
.snav-item:hover::before { opacity: 1; }
.snav-item:hover .snav-icon {
  background: rgba(26,95,163,.4);
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 4px 12px rgba(26,95,163,.45);
}
.snav-item:hover .snav-icon i { color: #7ec8f7; }

/* Icono en caja */
.snav-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .22s, transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
}
.snav-icon i { font-size: 15px; color: rgba(255,255,255,.5); transition: color .22s; }

.snav-text { flex: 1; }

/* Estado activo */
.snav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(26,95,163,.35), rgba(26,95,163,.12));
  border-color: rgba(26,95,163,.4);
  font-weight: 600;
}
.snav-item.active::before { opacity: 1; }
.snav-item.active .snav-icon {
  background: linear-gradient(135deg, #1a5fa3, #0d4580);
  box-shadow: 0 4px 16px rgba(26,95,163,.6), 0 0 0 1px rgba(126,200,247,.25);
  transform: scale(1);
}
.snav-item.active .snav-icon i { color: #fff; }

/* Dot indicador del ítem activo */
.snav-active-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #7ec8f7;
  box-shadow: 0 0 6px #7ec8f7;
  flex-shrink: 0;
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.7); }
}

/* Links externos */
.snav-ext-ico { font-size: 10px; color: rgba(255,255,255,.25); transition: color .2s; }
.snav-external:hover .snav-ext-ico { color: rgba(255,255,255,.55); }

/* Spacer flexible */
.snav-spacer { flex: 1; min-height: 12px; }

/* ── User strip ───────────────────── */
.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  position: relative; z-index: 1; flex-shrink: 0;
}
.suser-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a5fa3 0%, #B4231C 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  box-shadow: 0 3px 10px rgba(26,95,163,.45);
  border: 1px solid rgba(255,255,255,.12);
}
.suser-info { flex: 1; min-width: 0; }
.suser-name {
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suser-role {
  font-size: 10px; color: rgba(255,255,255,.35);
  text-transform: capitalize; letter-spacing: .4px; margin-top: 1px;
}
.suser-logout {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: rgba(248,113,113,.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(248,113,113,.65); text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
  border: 1px solid rgba(248,113,113,.12);
}
.suser-logout:hover {
  background: rgba(248,113,113,.22); color: #f87171;
  transform: scale(1.12); border-color: rgba(248,113,113,.3);
}
.suser-logout i { font-size: 14px; }

/* Compat legado */
.sidebar-sub    { color: rgba(255,255,255,.28); font-size: .65rem; letter-spacing: .1em; }
.sidebar-divider { border-top: 1px solid rgba(255,255,255,.07); margin: 8px 0; }
.sidebar-logout  { margin-top: auto; }
.sidebar-logout a { color: rgba(255,100,100,.7) !important; }
.sidebar-logout a:hover { color: #f87171 !important; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(11,58,102,.05);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  position: sticky; top: 0; z-index: 90;
}
.topbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--azul), var(--rojo), var(--azul-mid), var(--rojo));
  background-size: 300% 100%;
  animation: gradientSlide 5s ease infinite;
  opacity: .7;
}
.topbar-burger { background: none; border: none; font-size: 1.35rem; color: var(--muted); display: none; cursor: pointer; }
.topbar-titulo { font-family: var(--cond); font-weight: 700; font-size: 1rem; text-transform: uppercase;
                 color: var(--ink); letter-spacing: .07em; flex: 1; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }
.topbar-nombre { font-size: 13px; color: var(--body); font-weight: 500; }
.topbar-logout { color: var(--muted); font-size: 1.1rem; transition: color .2s; }
.topbar-logout:hover { color: var(--rojo); }
.topbar-rol { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px;
              font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }

/* ── ALERTAS ────────────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
         margin-bottom: 1.2rem; font-size: 14px; font-weight: 500; animation: fadeIn .25s ease; }
.alert span { flex: 1; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; color: inherit;
               opacity: .55; font-size: 18px; display: flex; align-items: center; }
.alert-close:hover { opacity: 1; }
.alert-ok  { background: rgba(29,122,61,.08); color: #166534; border: 1px solid rgba(29,122,61,.2); }
.alert-err { background: rgba(180,35,28,.07); color: var(--rojo); border: 1px solid rgba(180,35,28,.22);
             box-shadow: 0 0 12px rgba(180,35,28,.08); }

/* ── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .25s, border-color .25s, transform .25s;
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--azul), var(--rojo));
  opacity: 0; transition: opacity .25s; z-index: 1;
}
.card:hover { box-shadow: 0 6px 28px rgba(11,58,102,.13); border-color: rgba(26,95,163,.28); transform: translateY(-1px); }
.card:hover::before { opacity: 1; }
.card-form { max-width: 780px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(11,58,102,.025), transparent);
}
.card-title {
  font-family: var(--cond); font-size: 1rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }

/* ── TABLA ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla thead th {
  padding: 10px 14px; text-align: left;
  font-family: var(--cond); font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--azul);
  background: linear-gradient(90deg, var(--azul-bg), #f5f9ff);
  border-bottom: 2px solid rgba(11,58,102,.12);
}
.tabla tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.tabla tbody tr:last-child { border-bottom: none; }
.tabla tbody tr:hover { background: rgba(11,58,102,.025); }
.tabla td { padding: 10px 14px; vertical-align: middle; }
.td-actions { white-space: nowrap; display: flex; gap: 4px; align-items: center; }

/* ── FORMULARIOS ────────────────────────────────────────────── */
.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-full  { grid-column: 1/-1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--azul); }
.form-group input:not([type="checkbox"]):not([type="radio"]), .form-group select, .form-group textarea {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--ink); background: var(--white);
  transition: border-color .2s, box-shadow .2s; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--azul-mid); box-shadow: 0 0 0 3px rgba(26,95,163,.1);
}
.form-group textarea { resize: vertical; }
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B3A66' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--white); color: var(--ink);
  outline: none; transition: border-color .2s;
}
.filter-bar input { flex: 1; min-width: 160px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--azul-mid); }
.filter-bar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B3A66' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
  -webkit-appearance: none; appearance: none;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; font-weight: normal; text-transform: none; letter-spacing: 0; }
.checkbox-label input { width: auto; accent-color: var(--azul); }

/* ── SECTION TITLE ──────────────────────────────────────────── */
.section-title {
  font-family: var(--cond); font-weight: 700; font-size: .95rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 3px; height: 15px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--rojo) 0%, var(--azul) 100%);
  border-radius: 2px;
}
.section-title.mt-2 { margin-top: 1.5rem; }

/* ── BOTONES ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-mid) 100%);
  color: #fff; border: none; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden;
  box-shadow: 0 3px 12px rgba(11,58,102,.28);
  transition: all .25s;
}
.btn-primary::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0d4a85 0%, var(--azul-3) 100%);
  transform: translateY(-2px); box-shadow: 0 6px 22px rgba(11,58,102,.4);
}
.btn-primary:hover::after { animation: shimmer .6s ease; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  background: var(--white); color: var(--azul); border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13.5px; font-weight: 600; cursor: pointer;
  position: relative; overflow: hidden; white-space: nowrap;
  transition: all .2s; box-shadow: 0 1px 4px rgba(11,58,102,.07);
}
.btn-secondary::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(11,58,102,.07), transparent);
  transform: skewX(-20deg);
}
.btn-secondary:hover {
  border-color: var(--azul-mid); color: var(--azul); background: var(--azul-bg);
  box-shadow: 0 3px 12px rgba(11,58,102,.12); transform: translateY(-1px);
}
.btn-secondary:hover::after { animation: shimmer .6s ease; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  background: linear-gradient(135deg, #8B0000 0%, var(--rojo) 100%);
  color: #fff; border: none; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 0 3px 12px rgba(180,35,28,.3); transition: all .25s;
}
.btn-danger::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transform: skewX(-20deg);
}
.btn-danger:hover { background: linear-gradient(135deg, #a50000 0%, var(--rojo-2) 100%); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(180,35,28,.45); }
.btn-danger:hover::after { animation: shimmer .6s ease; }

.btn-sm  { padding: 6px 12px; font-size: 12px; white-space: nowrap; }
.btn-auth { width: 100%; padding: 13px;
            background: linear-gradient(135deg, var(--azul) 0%, var(--azul-mid) 100%);
            color: #fff; border: none; border-radius: var(--radius);
            font-size: 15px; font-weight: 700; cursor: pointer;
            position: relative; overflow: hidden;
            box-shadow: 0 4px 16px rgba(11,58,102,.3); transition: all .25s; }
.btn-auth::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg);
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(11,58,102,.4); }
.btn-auth:hover::after { animation: shimmer .65s ease; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--azul-bg); color: var(--azul); border: none;
  cursor: pointer; font-size: 14px;
  transition: all .2s; box-shadow: 0 1px 4px rgba(11,58,102,.08);
}
.btn-icon:hover { background: var(--azul); color: #fff; box-shadow: 0 3px 12px rgba(11,58,102,.3); transform: translateY(-1px); }
.btn-icon-danger { background: rgba(180,35,28,.08); color: var(--rojo); }
.btn-icon-danger:hover { background: var(--rojo); color: #fff; box-shadow: 0 3px 12px rgba(180,35,28,.4); }
.btn-icon-warn   { background: rgba(217,119,6,.08);  color: var(--orange); }
.btn-icon-warn:hover { background: var(--orange); color: #fff; }
.btn-icon-ok     { background: rgba(29,122,61,.08);  color: var(--green); }
.btn-icon-ok:hover { background: var(--green); color: #fff; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge-estado, .badge-hom, .badge-cot, .badge-rol {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
}
.badge-prospecto   { background: rgba(107,114,128,.1);  color: var(--muted); }
.badge-activo      { background: rgba(29,122,61,.1);    color: var(--green); }
.badge-inactivo    { background: rgba(180,35,28,.1);    color: var(--rojo); }
.badge-admin       { background: rgba(11,58,102,.12);   color: var(--azul); }
.badge-ingeniero   { background: rgba(29,122,61,.12);   color: var(--green); }
.badge-cliente     { background: rgba(217,119,6,.12);   color: var(--orange); }
.badge-cot-borrador   { background: rgba(107,114,128,.1);  color: var(--muted); }
.badge-cot-enviada    { background: rgba(11,58,102,.12);   color: var(--azul); }
.badge-cot-en_revision{ background: rgba(217,119,6,.12);   color: var(--orange); }
.badge-cot-aceptada   { background: rgba(29,122,61,.12);   color: var(--green); }
.badge-cot-rechazada  { background: rgba(180,35,28,.12);   color: var(--rojo); }
.badge-cot-vencida    { background: rgba(107,114,128,.1);  color: var(--muted); }
.badge-hom-configurando{ background: rgba(107,114,128,.1); color: var(--muted); }
.badge-hom-en_proceso  { background: rgba(11,58,102,.12);  color: var(--azul); }
.badge-hom-completada  { background: rgba(29,122,61,.12);  color: var(--green); }
.badge-hom-rechazada   { background: rgba(180,35,28,.12);  color: var(--rojo); }
.badge-proy-propuesta   { background: rgba(107,114,128,.1); color: var(--muted); }
.badge-proy-enejecucion { background: rgba(11,58,102,.12);  color: var(--azul); }
.badge-proy-completado  { background: rgba(29,122,61,.12);  color: var(--green); }
.badge-proy-cancelado   { background: rgba(180,35,28,.12);  color: var(--rojo); }
.topbar-rol { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.tag-sm {
  font-family: var(--cond); font-size: 10.5px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; padding: 2px 8px;
  background: var(--azul-bg); color: var(--azul); border-radius: 4px;
  border: 1px solid rgba(11,58,102,.15);
}

/* ── STATS DASHBOARD ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 1.2rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all .25s; position: relative; overflow: hidden;
  animation: staggerIn .45s ease both;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--azul), var(--rojo));
  opacity: 0; transition: opacity .25s;
}
.stat-card::after {
  content: ''; position: absolute; top: -28px; right: -28px;
  width: 75px; height: 75px; border-radius: 50%;
  background: rgba(11,58,102,.04); pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(11,58,102,.13); border-color: rgba(26,95,163,.25); }
.stat-card:hover::before { opacity: 1; }
.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .10s; }
.stat-card:nth-child(3) { animation-delay: .15s; }
.stat-card:nth-child(4) { animation-delay: .20s; }
.stat-card:nth-child(5) { animation-delay: .25s; }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
  transition: transform .25s;
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); }
.stat-icon.blue   { background: var(--azul-bg);          color: var(--azul);   box-shadow: 0 0 14px rgba(11,58,102,.15); }
.stat-icon.green  { background: rgba(29,122,61,.1);       color: var(--green);  box-shadow: 0 0 14px rgba(29,122,61,.15); }
.stat-icon.orange { background: rgba(217,119,6,.12);      color: var(--orange); box-shadow: 0 0 14px rgba(217,119,6,.15); }
.stat-icon.red    { background: rgba(180,35,28,.1);       color: var(--rojo);   box-shadow: 0 0 14px rgba(180,35,28,.18); }
.stat-num   { font-family: var(--cond); font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── WELCOME BANNER ─────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #061e38 0%, var(--azul) 50%, #0d4e8a 100%);
  border-radius: var(--radius); padding: 1.6rem 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
  box-shadow: 0 8px 32px rgba(11,58,102,.3);
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 22px 22px;
}
.wb-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wb-circle-1 {
  position: absolute; right: 16%; top: -30%;
  width: 110px; height: 110px; border-radius: 50%;
  border: 20px solid rgba(255,255,255,.07);
  animation: floatGeo 8s ease-in-out infinite;
}
.wb-circle-2 {
  position: absolute; right: 4%; bottom: -35%;
  width: 150px; height: 150px; border-radius: 50%;
  border: 28px solid rgba(180,35,28,.14);
  animation: floatGeo 10s ease-in-out infinite reverse;
}
.wb-diamond {
  position: absolute; right: 28%; top: 10%;
  width: 30px; height: 30px;
  border: 2px solid rgba(255,255,255,.12);
  transform: rotate(45deg);
  animation: rotateSlow 20s linear infinite;
}
.wb-line {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(180,35,28,.6), transparent);
}
.wb-text { position: relative; z-index: 1; }
.welcome-banner h2 { font-family: var(--cond); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; color: #fff; margin: 0 0 4px; }
.welcome-banner p  { color: rgba(255,255,255,.65); font-size: 14px; margin: 0; }
.wb-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── GRID 2 COLUMNAS ────────────────────────────────────────── */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* ── CHART CONTAINER ────────────────────────────────────────── */
.chart-wrap { padding: 1rem 1.5rem 1.5rem; }
.chart-wrap canvas { max-height: 210px; }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar { background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar-fill {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--azul), var(--azul-mid));
  box-shadow: 0 0 6px rgba(26,95,163,.4);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  animation: progressFill .8s ease both;
}

/* ── QUICK ACTIONS ──────────────────────────────────────────── */
.quick-actions { display: flex; gap: 1rem; padding: 1.5rem; flex-wrap: wrap; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 1.2rem 1.5rem; background: var(--white);
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: all .25s; font-size: 13px; font-weight: 600;
  color: var(--body); min-width: 100px;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 6px rgba(11,58,102,.07);
}
.qa-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(11,58,102,.07), transparent);
  transform: skewX(-20deg);
}
.qa-btn i { font-size: 1.5rem; color: var(--azul); }
.qa-btn:hover { border-color: var(--azul-mid); color: var(--azul); background: var(--azul-bg);
                box-shadow: 0 4px 16px rgba(11,58,102,.14); transform: translateY(-2px); }
.qa-btn:hover::after { animation: shimmer .6s ease; }

/* ── CLIENTE ────────────────────────────────────────────────── */
.cliente-header { padding: 18px 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.cliente-header-body { display: flex; gap: 16px; align-items: flex-start; }
.cliente-badge {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-mid) 100%);
  color: #fff; font-family: var(--cond); font-size: 1.3rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(11,58,102,.3);
}
.cliente-header-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.contacto-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.contacto-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--azul-bg); color: var(--azul);
  font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.info-item i { color: var(--muted); font-size: 16px; flex-shrink: 0; }

/* ── COTIZACIÓN ─────────────────────────────────────────────── */
.cot-editar-header, .cot-ver-header {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 10px; box-shadow: var(--shadow);
}
.cot-numero { font-family: var(--cond); font-size: .95rem; font-weight: 700; letter-spacing: .08em;
              text-transform: uppercase; color: var(--rojo); margin-bottom: 2px; }

/* ── TIMELINE ───────────────────────────────────────────────── */
.timeline { padding: 14px 18px; display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; padding: 10px 0; border-left: 2px solid var(--border); margin-left: 16px; }
.timeline-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--azul-bg); color: var(--azul);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  flex-shrink: 0; margin-left: -17px;
}
.timeline-body { flex: 1; padding-bottom: 4px; }
.timeline-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.timeline-desc { font-size: 13.5px; color: var(--body); }

/* ── HOMOLOGACIÓN ───────────────────────────────────────────── */
.hom-header { padding: 18px 20px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.doc-tipos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px; }
.doc-tipo-card  { border: 1.5px solid var(--border); border-radius: 8px; padding: 14px;
                  background: var(--white); transition: all .2s; }
.doc-tipo-card:hover { box-shadow: 0 4px 16px rgba(10,22,40,.1); transform: translateY(-1px); }
.doc-tipo-aprobado  { border-color: rgba(29,122,61,.35);  background: rgba(29,122,61,.04); }
.doc-tipo-observado { border-color: rgba(217,119,6,.35);  background: rgba(217,119,6,.04); }
.doc-tipo-rechazado { border-color: rgba(180,35,28,.35);  background: rgba(180,35,28,.04); }
.doc-tipo-pendiente { border-color: rgba(11,58,102,.25);  background: rgba(11,58,102,.03); }
.doc-tipo-sin_subir { border-color: var(--border); background: var(--bg); }
.doc-tipo-top    { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.doc-tipo-nombre { font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-tipo-desc   { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.doc-tipo-archivo{ display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--body);
                   background: var(--bg); padding: 6px 10px; border-radius: 5px; margin-top: 8px; }
.doc-tipo-actions{ margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── UPLOAD CARD ────────────────────────────────────────────── */
.doc-upload-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 10px; padding: 18px 20px; transition: box-shadow .2s; }
.doc-upload-aprobado  { border-color: rgba(29,122,61,.4);  background: rgba(29,122,61,.04); }
.doc-upload-observado { border-color: rgba(217,119,6,.4);  background: rgba(217,119,6,.04); }
.doc-upload-rechazado { border-color: rgba(180,35,28,.4);  background: rgba(180,35,28,.04); }
.doc-upload-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.doc-upload-num  {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--azul), var(--azul-mid));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.doc-upload-nombre { font-size: 15px; font-weight: 600; color: var(--ink); }
.doc-upload-desc   { font-size: 13px; color: var(--muted); margin-top: 4px; }
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border); border-radius: 8px; padding: 20px; cursor: pointer;
  transition: all .2s; text-align: center;
}
.upload-zone:hover, .upload-zone.zone-selected { border-color: var(--azul); background: var(--azul-bg); }
.upload-zone i { font-size: 2rem; color: var(--azul); }
.upload-zone span { font-size: 14px; font-weight: 600; color: var(--body); }
.upload-zone small { font-size: 12px; color: var(--muted); }
.doc-upload-form { margin-top: 12px; }

/* ── AUTH ───────────────────────────────────────────────────── */
.auth-page { display: flex; min-height: 100vh; }
.auth-card  { width: 420px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center;
              padding: 48px 44px; background: var(--white); }
.auth-page-simple .auth-card { max-width: 400px; margin: auto; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 36px 40px; }
.auth-bg {
  flex: 1; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #061e38 0%, #0B3A66 55%, #0f5298 100%);
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.auth-bg::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.auth-bg-text { max-width: 380px; position: relative; z-index: 1; }
.auth-bg-badge { display: inline-block; padding: 4px 14px; background: rgba(180,35,28,.9);
                 color: #fff; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: .8px;
                 text-transform: uppercase; margin-bottom: 20px; }
.auth-bg h2 { font-family: var(--cond); font-size: 2.8rem; font-weight: 700; color: #fff; line-height: 1.1; margin-bottom: 16px; }
.auth-bg p  { font-size: 15px; color: rgba(255,255,255,.65); line-height: 1.6; }
.auth-logo  { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-logo-badge { width: 44px; height: 44px; background: var(--azul); border-radius: 10px; color: #fff;
                   font-family: var(--cond); font-size: 1.2rem; font-weight: 700;
                   display: flex; align-items: center; justify-content: center; }
.auth-logo-title { font-family: var(--cond); font-size: 1.1rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.auth-logo-sub   { font-size: 11px; color: var(--muted); letter-spacing: .8px; }
.auth-h1    { font-family: var(--cond); font-size: 1.5rem; font-weight: 700; letter-spacing: .06em;
              text-transform: uppercase; color: var(--ink); margin-bottom: 24px; }
.auth-form  { display: flex; flex-direction: column; gap: 16px; }
.auth-links { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-links a { color: var(--azul); font-weight: 600; }
.auth-footer-link { margin-top: 24px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-footer-link a { color: var(--muted); text-decoration: underline; }
.input-eye-wrap { position: relative; }
.input-eye-wrap input { width: 100%; }
.eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none;
           border: none; cursor: pointer; color: var(--muted); font-size: 16px; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state { padding: 3rem; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .4; color: var(--azul); }
.empty-state p { font-size: 14px; }

/* ── MISC ───────────────────────────────────────────────────── */
.link-azul      { color: var(--azul); font-weight: 500; }
.link-azul:hover{ text-decoration: underline; }
.text-muted     { color: var(--muted); }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11,58,102,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(11,58,102,.4); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) { .grid-2col { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .topbar-burger { display: flex; }
  .auth-bg { display: none; }
  .auth-card { width: 100%; padding: 36px 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
  .app-content { padding: 14px; }
}

/* ══ COTIZACIONES — DISEÑO PROFESIONAL ══════════════════════ */

/* ── Page header + breadcrumb ───────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.page-title {
  font-family: var(--cond); font-size: 1.45rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0;
}
.page-subtitle { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
.page-topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 1.2rem;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb-link { color: var(--azul-mid); display: flex; align-items: center; gap: 4px; transition: color .2s; }
.breadcrumb-link:hover { color: var(--azul); text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-4); font-size: 12px; }
.breadcrumb-cur { font-family: var(--cond); font-weight: 700; letter-spacing: .05em; color: var(--ink); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Ver cotización: layout documento + panel ───────────── */
.cot-ver-layout {
  display: grid; grid-template-columns: 1fr 290px; gap: 1.2rem; align-items: start;
}
@media (max-width: 1050px) { .cot-ver-layout { grid-template-columns: 1fr; } }

/* ── Documento (carta) ──────────────────────────────────── */
.cot-doc {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden;
}

.cot-doc-head {
  background: linear-gradient(135deg,#061e38 0%,var(--azul) 55%,#0d4e8a 100%);
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.cot-doc-head::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px,transparent 1px);
  background-size: 18px 18px;
}
.cot-doc-head::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg,transparent,rgba(180,35,28,.6),transparent);
}
.cot-doc-empresa { display:flex; align-items:flex-start; gap:12px; position:relative; z-index:1; }
.cot-doc-logo {
  width:40px; height:40px; border-radius:8px; flex-shrink:0;
  background:rgba(255,255,255,.1); border:1.5px solid rgba(255,255,255,.18);
  color:#fff; font-family:var(--cond); font-weight:700; font-size:.95rem;
  display:flex; align-items:center; justify-content:center;
}
.cot-empresa-name {
  color:#fff; font-family:var(--cond); font-size:1rem; font-weight:700;
  letter-spacing:.1em; text-transform:uppercase; margin-bottom:3px;
}
.cot-empresa-meta { color:rgba(255,255,255,.5); font-size:11px; line-height:1.65; }
.cot-doc-numblock { text-align:right; position:relative; z-index:1; }
.cot-doc-num {
  font-family:var(--cond); font-size:1.35rem; font-weight:700;
  color:#ffb3b0; letter-spacing:.06em; margin-bottom:4px;
}
.cot-doc-tipo { font-size:9px; letter-spacing:2.5px; text-transform:uppercase; color:rgba(255,255,255,.4); margin-bottom:8px; }

/* ── Meta strip ─────────────────────────────────────────── */
.cot-doc-meta {
  display:flex; border-bottom:1px solid var(--border);
  background:linear-gradient(90deg,var(--gray-1),var(--white));
  flex-wrap:wrap;
}
.cot-meta-cell {
  flex:1; min-width:110px; padding:9px 16px;
  border-right:1px solid var(--border);
}
.cot-meta-cell:last-child { border-right:none; }
.cot-meta-lbl {
  font-size:9px; font-weight:700; letter-spacing:1px; text-transform:uppercase;
  color:var(--muted); margin-bottom:3px; display:flex; align-items:center; gap:4px;
}
.cot-meta-val { font-size:13px; font-weight:600; color:var(--ink); }
.cot-meta-val.vencido { color:var(--rojo); }
.cot-meta-val.pronto  { color:var(--orange); }

/* ── Parties section ─────────────────────────────────────── */
.cot-parties {
  display:grid; grid-template-columns:1fr 1fr; gap:0;
  border-bottom:1px solid var(--border);
}
.cot-party { padding:16px 22px; }
.cot-party + .cot-party { border-left:1px solid var(--border); }
.cot-sect-lbl {
  font-size:9px; font-weight:700; letter-spacing:2px; text-transform:uppercase;
  color:var(--rojo); margin-bottom:7px;
}
.cot-client-name { font-size:.95rem; font-weight:700; color:var(--ink); margin-bottom:4px; }
.cot-client-meta {
  font-size:12px; color:var(--muted);
  display:flex; align-items:center; gap:5px; margin-top:3px;
}

/* ── Asunto banner ───────────────────────────────────────── */
.cot-doc-asunto {
  background:linear-gradient(90deg,var(--azul-bg),#f0f7ff);
  border-bottom:1px solid rgba(11,58,102,.1);
  padding:10px 22px; display:flex; align-items:center; gap:10px;
}
.cot-doc-asunto-lbl { font-size:9.5px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--azul); flex-shrink:0; }
.cot-doc-asunto-val { font-size:13.5px; font-weight:600; color:var(--ink); }
.cot-doc-alcance-txt { padding:10px 22px 14px; font-size:13px; color:var(--body); line-height:1.65; border-bottom:1px solid var(--border); }

/* ── Items table ─────────────────────────────────────────── */
.cot-items-tbl { width:100%; border-collapse:collapse; }
.cot-items-tbl thead th {
  padding:9px 12px; text-align:left;
  font-family:var(--cond); font-size:9px; font-weight:700; letter-spacing:1.5px;
  text-transform:uppercase; color:var(--azul);
  background:linear-gradient(90deg,var(--azul-bg),#f5f9ff);
  border-top:1px solid var(--border); border-bottom:2px solid rgba(11,58,102,.1);
}
.cot-items-tbl thead th.tr { text-align:right; }
.cot-items-tbl thead th.tc { text-align:center; }
.cot-items-tbl tbody tr { border-bottom:1px solid var(--border); transition:background .1s; }
.cot-items-tbl tbody tr:last-child { border-bottom:none; }
.cot-items-tbl tbody tr:nth-child(even) { background:var(--gray-1); }
.cot-items-tbl tbody tr:hover { background:var(--azul-bg); }
.cot-items-tbl td { padding:9px 12px; vertical-align:top; font-size:13px; }
.cot-item-num { color:var(--gray-4); font-size:11px; width:28px; text-align:center; }
.cot-item-title { font-weight:700; color:var(--ink); font-size:13px; }
.cot-item-desc { font-size:12px; color:var(--body); margin-top:3px; line-height:1.5; }
.cot-item-tr { text-align:right; }
.cot-item-total { text-align:right; font-weight:700; color:var(--ink); }
.cot-item-sym { font-size:10px; color:var(--muted); font-weight:400; }

/* ── Totales ─────────────────────────────────────────────── */
.cot-doc-totales { display:flex; justify-content:flex-end; padding:16px 22px; border-bottom:1px solid var(--border); background:var(--gray-1); }
.cot-totales-wrap { width:265px; }
.cot-total-line { display:flex; justify-content:space-between; align-items:center; padding:5px 10px; font-size:13.5px; border-radius:4px; }
.cot-total-line .lbl { color:var(--muted); }
.cot-total-line .val { font-weight:600; color:var(--ink); }
.cot-total-line.dsc .lbl,.cot-total-line.dsc .val { color:var(--rojo); }
.cot-total-line.sub { background:var(--azul-bg); }
.cot-total-line.sub .lbl,.cot-total-line.sub .val { color:var(--azul); font-weight:700; }
.cot-total-line.grand { background:linear-gradient(135deg,var(--azul),var(--azul-mid)); margin-top:8px; border-radius:var(--radius); box-shadow:0 4px 14px rgba(11,58,102,.22); padding:10px 14px; }
.cot-total-line.grand .lbl,.cot-total-line.grand .val { color:#fff!important; font-size:15px!important; font-weight:700!important; }

/* ── Alcances Generales ──────────────────────────────────── */
.cot-alcances { border-top:1px solid var(--border); }
.cot-alcances-head {
  background:linear-gradient(90deg,var(--azul),var(--azul-mid));
  padding:9px 22px;
  font-family:var(--cond); font-size:10px; font-weight:700; letter-spacing:2px;
  text-transform:uppercase; color:#fff;
}
.cot-alcances-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.cot-alcances-table tr { border-bottom:1px solid var(--border); }
.cot-alcances-table tr:last-child { border-bottom:none; }
.cot-alcances-table tr:nth-child(even) { background:var(--gray-1); }
.cot-alc-lbl { width:170px; padding:8px 14px; font-weight:700; color:var(--azul); vertical-align:top; white-space:nowrap; background:rgba(11,58,102,.03); border-right:1px solid var(--border); }
.cot-alc-val { padding:8px 14px; color:var(--body); line-height:1.6; }

/* ── Condiciones al pie ──────────────────────────────────── */
.cot-doc-cond { padding:14px 22px; }
.cot-cond-txt { font-size:12.5px; color:var(--muted); line-height:1.7; background:var(--gray-1); border-radius:6px; padding:10px 14px; border-left:3px solid var(--border); white-space:pre-line; }

/* ── Panel lateral (ver) ─────────────────────────────────── */
.cot-side-panel { display:flex; flex-direction:column; gap:1rem; }
.cot-panel-form { padding:.9rem 1rem; display:flex; flex-direction:column; gap:8px; }
.cot-panel-select { width:100%; padding:8px 10px; border:1.5px solid var(--border); border-radius:8px; font-size:13px; background:var(--white); color:var(--ink); }
.cot-panel-ta { width:100%; padding:8px 10px; border:1.5px solid var(--border); border-radius:8px; font-size:13px; resize:vertical; }
.cot-panel-btn { width:100%; }

/* ── Moneda badge ────────────────────────────────────────── */
.badge-mon { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; letter-spacing:.5px; }
.badge-mon-pen { background:rgba(29,122,61,.1); color:var(--green); }
.badge-mon-usd { background:rgba(11,58,102,.1); color:var(--azul); }

/* ── Lista cotizaciones ──────────────────────────────────── */
.cot-client-badge {
  width:30px; height:30px; border-radius:7px; flex-shrink:0;
  background:linear-gradient(135deg,var(--azul),var(--azul-mid));
  color:#fff; font-family:var(--cond); font-weight:700; font-size:11px;
  display:flex; align-items:center; justify-content:center;
}
.cot-num-link { color:var(--rojo); font-weight:700; font-family:var(--cond); letter-spacing:.04em; font-size:13.5px; }
.cot-num-link:hover { text-decoration:underline; }

/* ── Editar cotización ───────────────────────────────────── */
.cot-edit-layout { display:grid; grid-template-columns:1fr 340px; gap:1.2rem; align-items:start; }
@media (max-width:1050px) { .cot-edit-layout { grid-template-columns:1fr; } }
.cot-section-title {
  font-family:var(--cond); font-weight:700; font-size:.9rem; text-transform:uppercase;
  letter-spacing:.08em; color:var(--ink); padding:12px 18px;
  border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px;
  background:linear-gradient(90deg,rgba(11,58,102,.025),transparent);
}
.cot-section-title i { color:var(--azul); font-size:15px; }

.cot-edit-main { display:flex; flex-direction:column; gap:1rem; }
.cot-edit-side  { display:flex; flex-direction:column; gap:1rem; }

/* totals strip (editar header) */
.cot-totals-strip { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.strip-item { font-size:12px; color:var(--muted); background:var(--gray-1); padding:3px 10px; border-radius:12px; }
.strip-item.dsc { color:var(--rojo); background:rgba(180,35,28,.07); }
.strip-item.total { background:rgba(11,58,102,.1); color:var(--azul); font-size:13px; }

/* subtotal preview */
.sub-preview { padding:9px 12px; background:var(--gray-1); border:1.5px solid var(--border); border-radius:8px; font-size:14px; font-weight:700; color:var(--azul); }

/* inputs misc */
.input-disabled { background:var(--gray-1)!important; color:var(--muted); cursor:not-allowed; }
.lbl-opt { font-size:10.5px; font-weight:400; color:var(--muted); margin-left:4px; }

/* moneda toggle */
.moneda-toggle { display:flex; gap:8px; flex-wrap:wrap; }
.mon-opt { flex:1; min-width:140px; display:flex; align-items:center; gap:8px; padding:10px 14px; border:2px solid var(--border); border-radius:10px; cursor:pointer; font-size:13px; font-weight:600; color:var(--muted); background:var(--white); transition:border-color .15s,background .15s,color .15s; user-select:none; }
.mon-opt input[type=radio] { display:none; }
.mon-opt.mon-active { border-color:var(--azul); background:var(--azul-bg); color:var(--azul); }
.mon-opt:hover:not(.mon-active) { border-color:var(--azul-mid); color:var(--azul-mid); }

/* alcances generales (editar / nueva) */
.alcances-grid { display:flex; flex-direction:column; }
.alc-row { display:flex; align-items:flex-start; gap:14px; padding:9px 0; border-bottom:1px solid var(--border); }
.alc-row:last-child { border-bottom:none; }
.alc-lbl { width:175px; flex-shrink:0; font-size:12px; font-weight:700; color:var(--azul); line-height:1.5; padding-top:8px; }
.alc-num { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:var(--azul); color:#fff; font-size:9px; font-weight:700; margin-right:5px; flex-shrink:0; }
.alc-input { flex:1; padding:8px 10px; border:1.5px solid var(--border); border-radius:8px; font-size:13px; font-family:inherit; resize:vertical; color:var(--body); transition:border-color .15s; }
.alc-input:focus { border-color:var(--azul); outline:none; }
.alc-val-static { flex:1; padding:9px 10px; font-size:13px; color:var(--muted); line-height:1.55; background:var(--gray-1); border-radius:6px; }

/* badges frecuente */
.badge-frecuente { background:#ECFDF5; color:#065F46; font-size:11px; font-weight:700; padding:2px 9px; border-radius:12px; border:1px solid #6EE7B7; }
.badge-frecuente-sm { background:#ECFDF5; color:#065F46; font-size:10px; font-weight:700; padding:1px 7px; border-radius:8px; margin-left:5px; }
.alert-frecuente { background:#ECFDF5; border:1px solid #6EE7B7; border-radius:8px; padding:10px 16px; margin-bottom:1rem; font-size:13px; color:#065F46; display:flex; align-items:center; gap:10px; }

/* nueva cotizacion layout */
.cot-nueva-layout { display:grid; grid-template-columns:1fr 280px; gap:1.2rem; align-items:start; }
@media (max-width:1050px) { .cot-nueva-layout { grid-template-columns:1fr; } }
.cot-nueva-form { display:flex; flex-direction:column; gap:1rem; }
.cot-nueva-info { display:flex; flex-direction:column; gap:1rem; position:sticky; top:80px; }

/* plantilla button (nueva) */
.alc-template { padding:9px 12px; margin-bottom:6px; border-radius:8px; border:1.5px solid var(--border); cursor:pointer; font-size:12.5px; font-weight:600; color:var(--azul); display:flex; align-items:center; gap:7px; transition:background .15s,border-color .15s; }
.alc-template:last-child { margin-bottom:0; }
.alc-template:hover { background:var(--azul-bg); border-color:var(--azul); }

/* editar items table */
.cot-items-edit-tbl { width:100%; border-collapse:collapse; }
.cot-items-edit-tbl th,.cot-items-edit-tbl td { padding:9px 10px; }
.cot-items-edit-tbl thead th { font-family:var(--cond); font-size:9px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--azul); background:var(--azul-bg); border-top:1px solid var(--border); border-bottom:2px solid rgba(11,58,102,.1); }
.cot-items-edit-tbl tbody tr { border-bottom:1px solid var(--border); }
.cot-items-edit-tbl tbody tr:hover { background:var(--azul-bg); }
.cot-items-edit-tbl .tc { text-align:center; }
.cot-items-edit-tbl .tr { text-align:right; }

/* timeline (ver: historial) */
.timeline { display:flex; flex-direction:column; gap:10px; }
.timeline-item { display:flex; align-items:flex-start; gap:10px; }
.timeline-icon { width:30px; height:30px; border-radius:8px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:14px; }
.timeline-body { flex:1; min-width:0; }
.timeline-meta { margin-bottom:2px; font-size:12px; }
.timeline-desc { font-size:12.5px; color:var(--body); line-height:1.55; }
.tag-sm { font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; background:var(--gray-1); color:var(--muted); border-radius:5px; padding:1px 6px; margin-left:4px; }

/* utility */
.tc { text-align:center; }
.tr { text-align:right; }

/* ── Doc list compacto (vista cliente + auditor) ─────────── */
.doc-list { display:flex; flex-direction:column; }

.doc-list-item { border-bottom:1px solid var(--border); }
.doc-list-item:last-child { border-bottom:none; }

.doc-list-row {
  display:grid;
  grid-template-columns: 30px 1fr auto auto;
  column-gap:14px;
  align-items:center;
  padding:11px 18px;
  transition:background .15s;
}
.doc-list-row:hover { background:var(--bg); }

.doc-list-num {
  width:26px; height:26px; border-radius:50%;
  background:var(--gray-1); border:1.5px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; color:var(--muted); flex-shrink:0;
}
.doc-list-item.doc-list-aprobado  .doc-list-num { background:rgba(22,101,52,.1);  border-color:var(--green);  color:var(--green); }
.doc-list-item.doc-list-observado .doc-list-num { background:rgba(217,119,6,.1);  border-color:var(--orange); color:var(--orange); }
.doc-list-item.doc-list-rechazado .doc-list-num { background:rgba(180,35,28,.1);  border-color:var(--rojo);   color:var(--rojo); }
.doc-list-item.doc-list-pendiente .doc-list-num { background:rgba(26,95,163,.08); border-color:var(--azul);   color:var(--azul); }
.doc-list-item.doc-list-no_subido .doc-list-num { background:rgba(217,119,6,.07); border-color:rgba(217,119,6,.35); color:var(--orange); }
.doc-list-item.doc-list-no_subido               { opacity:.82; }

.doc-list-nombre { font-size:13.5px; font-weight:600; color:var(--ink); }
.doc-list-desc   { font-size:12px; color:var(--muted); margin-top:2px; }
.doc-list-file   { font-size:11px; color:var(--azul); margin-top:4px; display:flex; align-items:center; gap:4px; }
.doc-list-obs    { font-size:12px; margin-top:5px; padding:5px 9px; border-radius:6px; display:flex; align-items:flex-start; gap:5px; line-height:1.45; }
.obs-observado   { background:rgba(217,119,6,.08); color:var(--orange); border-left:2.5px solid var(--orange); }
.obs-rechazado   { background:rgba(180,35,28,.08); color:var(--rojo);   border-left:2.5px solid var(--rojo); }

.doc-list-estado { flex-shrink:0; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.doc-estado-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size:11.5px; font-weight:600; padding:3px 9px;
  border-radius:99px; white-space:nowrap;
}
.doc-estado-badge.aprobado   { background:rgba(22,101,52,.1);  color:var(--green); }
.doc-estado-badge.observado  { background:rgba(217,119,6,.1);  color:var(--orange); }
.doc-estado-badge.rechazado  { background:rgba(180,35,28,.1);  color:var(--rojo); }
.doc-estado-badge.en-revision{ background:rgba(26,95,163,.08); color:var(--azul); }
.doc-estado-badge.sin-subir  { background:var(--gray-1);       color:var(--muted); }
.doc-revisado-label { font-size:10px; font-weight:700; color:var(--green); display:flex; align-items:center; gap:3px; text-transform:uppercase; letter-spacing:.4px; }

.doc-list-action { flex-shrink:0; display:flex; align-items:center; gap:5px; }

/* Botones de acción rápida (aprobar / observar) */
.btn-accion-quick {
  padding:4px 10px; font-size:11.5px; font-weight:600; border-radius:7px; cursor:pointer;
  display:inline-flex; align-items:center; gap:4px; border:1.5px solid;
  transition:opacity .15s; white-space:nowrap; background:none;
}
.btn-accion-quick.aprobar-q { color:var(--green);  border-color:rgba(22,101,52,.3);  background:rgba(22,101,52,.1); }
.btn-accion-quick.aprobar-q:hover { background:rgba(22,101,52,.2); }
.btn-accion-quick.obs-q     { color:var(--orange); border-color:rgba(217,119,6,.3);  background:rgba(217,119,6,.1); }
.btn-accion-quick.obs-q:hover { background:rgba(217,119,6,.2); }

/* Panel expandible de obs/rechazo */
.doc-obs-form {
  background:rgba(245,158,11,.04);
  border-top:1px solid rgba(217,119,6,.18);
  padding:12px 18px 14px;
}
