.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:'IBM Plex Mono', monospace; font-size:14px; font-weight:500;
  padding:12px 20px; border-radius:999px; border:1px solid transparent;
  cursor:pointer; text-decoration:none; transition:background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:disabled{opacity:.6; cursor:wait;}
.btn-primary{background:var(--blue); color:#fff;}
.btn-primary:hover{background:var(--blue-bright); color:#fff;}
.btn-ghost{background:transparent; color:var(--text); border-color:var(--line);}
.btn-ghost:hover{border-color:#3A3A46; background:var(--surface-2);}
.btn-sm{padding:10px 16px; font-size:13px;}
.field span, .field > span{
  display:block; font-family:'IBM Plex Mono', monospace; font-size:12px;
  letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-bottom:8px;
}
.field input, .field select, .field textarea{
  width:100%; background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  color:var(--text); padding:12px 14px; font:inherit; font-size:15px;
}
.field input:focus, .field select:focus, .field textarea:focus{
  outline:none; border-color:var(--blue-bright); box-shadow:0 0 0 3px rgba(59,158,255,.15);
}
.field textarea{min-height:120px; resize:vertical;}

.portal-shell{min-height:100vh; display:flex; flex-direction:column;}
.portal-top{
  border-bottom:1px solid var(--line);
  background:rgba(11,11,16,.85);
  backdrop-filter:blur(12px);
  position:sticky; top:0; z-index:30;
}
.portal-top-inner{
  max-width:1040px; margin:0 auto; padding:16px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.portal-user{font-family:'IBM Plex Mono', monospace; font-size:13px; color:var(--muted);}
.portal-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.portal-nav{display:flex; gap:16px; flex-wrap:wrap; align-items:center;}
.portal-nav a{
  font-family:'IBM Plex Mono', monospace; font-size:13px;
  color:var(--muted); text-decoration:none;
}
.portal-nav a:hover, .portal-nav a.active{color:var(--blue-bright);}
@media (max-width:820px){
  .portal-top-inner{flex-wrap:wrap;}
  .portal-nav{order:3; width:100%; padding-top:4px;}
}
.badge-stack{display:flex; flex-direction:column; align-items:flex-end; gap:8px;}
.status-pill.estado-diseno{color:#9B9BA8;}
.status-pill.estado-desarrollo{color:#F0C674; border-color:rgba(240,198,116,.35);}
.status-pill.estado-pruebas{color:#3B9EFF; border-color:rgba(59,158,255,.35);}
.status-pill.estado-produccion{color:#5DDC8A; border-color:rgba(93,220,138,.35);}
.status-pill.estado-pausada{color:#FF8E8E; border-color:rgba(255,142,142,.35);}
.health-dot{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--muted);
}
.health-dot i{
  width:10px; height:10px; border-radius:50%; background:#6B6B78; display:inline-block;
}
.health-dot.ok i{background:#5DDC8A; box-shadow:0 0 0 3px rgba(93,220,138,.2);}
.health-dot.atencion i{background:#F0C674; box-shadow:0 0 0 3px rgba(240,198,116,.2);}
.health-dot.critico i{background:#FF8E8E; box-shadow:0 0 0 3px rgba(255,142,142,.2);}
.logic-text{color:var(--text); font-size:16px; line-height:1.6; margin-bottom:22px;}
.flow-diagram{
  display:flex; align-items:stretch; gap:8px; flex-wrap:wrap;
  overflow-x:auto; padding-bottom:4px;
}
.flow-node{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  padding:14px 16px; min-width:120px; max-width:180px;
  display:flex; align-items:center; justify-content:center; text-align:center;
}
.flow-node span{font-size:13px; font-weight:600; line-height:1.35;}
.flow-node.system{border-color:rgba(59,158,255,.35); background:rgba(0,120,209,.1);}
.flow-arrow{
  display:flex; align-items:center; color:var(--muted);
  font-family:'IBM Plex Mono', monospace; padding:0 2px;
}
.health-stats{
  display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px;
}
@media (max-width:640px){ .health-stats{grid-template-columns:repeat(2,1fr);} }
.health-stats div{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:14px;
}
.health-stats strong{display:block; font-size:22px; letter-spacing:-.02em;}
.health-stats span{font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em;}
.health-chart{
  display:flex; align-items:flex-end; gap:3px; height:120px;
  padding:12px 8px 0; border-top:1px solid var(--line);
}
.health-chart .bar{
  flex:1; min-width:4px; border-radius:3px 3px 0 0; opacity:.9;
}
.health-chart .bar.ok{background:#5DDC8A;}
.health-chart .bar.err{background:#FF8E8E;}
.chart-empty, .chart-caption, .muted{color:var(--muted); font-size:13px;}
.chart-caption{margin-top:10px;}
.portal-main{flex:1; padding:40px 0 72px;}
.portal-header{
  display:flex; justify-content:space-between; align-items:flex-end;
  gap:16px; flex-wrap:wrap; margin-bottom:28px;
}
.portal-header h1{font-size:clamp(28px,4vw,40px); margin:0;}
.portal-header p{color:var(--muted); margin-top:8px; max-width:520px;}

.status-pill{
  display:inline-flex; align-items:center; gap:6px;
  font-family:'IBM Plex Mono', monospace; font-size:12px;
  padding:6px 12px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--muted);
}
.status-pill.submitted{ color:#9B9BA8; }
.status-pill.reviewing{ color:#F0C674; border-color:rgba(240,198,116,.35); }
.status-pill.quoted{ color:#3B9EFF; border-color:rgba(59,158,255,.35); }
.status-pill.accepted{ color:#5DDC8A; border-color:rgba(93,220,138,.35); }
.status-pill.declined{ color:#FF8E8E; border-color:rgba(255,142,142,.35); }

.project-list{display:flex; flex-direction:column; gap:12px;}
.project-item{
  display:block; text-decoration:none; color:inherit;
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  padding:20px 22px; transition:transform .15s, border-color .15s, box-shadow .15s;
}
.project-item:hover{
  transform:translateY(-2px); border-color:#3A3A46;
  box-shadow:0 12px 32px rgba(0,0,0,.3);
}
.project-item-top{
  display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap;
}
.project-item h3{font-size:18px; font-weight:700; margin:0 0 6px;}
.project-item .meta{font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--muted);}
.project-item .desc{
  margin-top:12px; color:var(--muted); font-size:14px; line-height:1.5;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

.empty-state{
  text-align:center; padding:56px 24px;
  background:var(--surface); border:1px dashed var(--line); border-radius:16px;
}
.empty-state h2{font-size:22px; margin-bottom:10px;}
.empty-state p{color:var(--muted); margin-bottom:24px;}

.login-card{
  max-width:440px; margin:48px auto 0;
  background:var(--surface); border:1px solid var(--line); border-radius:20px;
  padding:36px 28px; position:relative;
}
.login-card::before{
  content:""; position:absolute; inset:-40% auto auto 50%;
  width:280px; height:180px; transform:translateX(-50%);
  background:radial-gradient(ellipse, var(--glow), transparent 70%);
  pointer-events:none;
}
.login-card > *{position:relative; z-index:1;}
.login-card h1{font-size:28px; margin-bottom:8px;}
.login-card .lead{color:var(--muted); margin-bottom:28px; font-size:15px; line-height:1.55;}
.auth-msg{margin-top:16px; font-family:'IBM Plex Mono', monospace; font-size:13px; color:var(--muted);}
.auth-msg.ok{color:#5DDC8A;}
.auth-msg.err{color:#FF8E8E;}

.detail-grid{display:grid; grid-template-columns:1.4fr .9fr; gap:18px;}
@media (max-width:860px){ .detail-grid{grid-template-columns:1fr;} }
.panel{
  background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px;
}
.panel h2{font-size:16px; margin-bottom:16px;}
.kv{display:grid; gap:12px;}
.kv-row{display:grid; grid-template-columns:140px 1fr; gap:8px; font-size:14px;}
.kv-row .k{font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding-top:2px;}
.kv-row .v{color:var(--text); white-space:pre-wrap; line-height:1.5;}
@media (max-width:520px){ .kv-row{grid-template-columns:1fr;} }

.quote-card{
  border:1px solid var(--line); border-radius:14px; padding:18px; background:var(--surface-2);
  margin-bottom:12px;
}
.quote-card .amount{
  font-size:22px; font-weight:800; letter-spacing:-.02em; margin:8px 0 10px;
}
.quote-card .summary{color:var(--text); font-size:15px; margin-bottom:8px;}
.quote-card .details{color:var(--muted); font-size:14px; line-height:1.5; white-space:pre-wrap;}
.quote-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:16px;}

.admin-box{margin-top:18px; padding-top:18px; border-top:1px solid var(--line);}
.link-muted{color:var(--muted); text-decoration:none; font-family:'IBM Plex Mono', monospace; font-size:13px;}
.link-muted:hover{color:var(--blue-bright);}
