/* Paleta SVP Aerospace: azul del logo (#00ADD8), grafitos y grises claros estilo Apple. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, .07);
  --fill: #f2f2f4;
  --svp: #00add8;
  --svp-deep: #0083b8;
  --svp-text: #007aa8;          /* azul con contraste suficiente para texto */
  --graphite: #3a3f47;
  --ok: #34c759;
  --busy: #ff9f0a;
  --down: #ff3b30;
  --radius: 24px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px -12px rgba(15, 30, 45, .14);
  --shadow-hi: 0 2px 4px rgba(0, 0, 0, .04), 0 24px 48px -18px rgba(0, 80, 120, .28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Fondo: halo azul muy suave arriba y retícula técnica casi invisible */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 480px at 50% -160px, rgba(0, 173, 216, .16), transparent 70%),
    radial-gradient(600px 400px at 100% 0, rgba(0, 131, 184, .07), transparent 70%);
}
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,0,0,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0, #000 10%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0, #000 10%, transparent 60%);
}
.aurora i { display: none; }

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.sub { margin: 6px 0 0; color: var(--ink-2); }
.wordmark, .brand strong { font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.wordmark span, .brand strong span { color: var(--svp-text); font-weight: 600; }

/* Logo SVP (blanco en origen) pintado en grafito con máscara */
.svp-mark {
  display: inline-block; width: 92px; height: 54px;
  background: var(--graphite);
  -webkit-mask: url(/svp-logo.png) center / contain no-repeat;
  mask: url(/svp-logo.png) center / contain no-repeat;
}

/* Botones y campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 14px; border: 0;
  background: var(--fill); color: var(--ink); font: 600 16px var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, opacity .2s, box-shadow .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { width: 100%; color: #fff; background: linear-gradient(180deg, #14b9e2, var(--svp-deep)); box-shadow: 0 10px 24px -10px rgba(0, 131, 184, .7); }
.btn.primary:hover { box-shadow: 0 14px 30px -10px rgba(0, 131, 184, .8); }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow); transition: color .2s, transform .15s;
}
.icon-btn:hover { color: var(--svp-text); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: block; text-align: left; margin-top: 14px; }
.field span { display: block; font-size: 12px; color: var(--ink-3); margin: 0 0 6px 4px; font-weight: 500; }
.field input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid transparent;
  background: var(--fill); color: var(--ink); font: 16px var(--font); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus { background: #fff; border-color: var(--svp); box-shadow: 0 0 0 4px rgba(0, 173, 216, .16); }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 4px 22px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--svp); }
.error { min-height: 20px; margin: 12px 0 0; color: var(--down); font-size: 14px; }

/* Login */
.login { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(390px, 100%); padding: 40px 32px 26px; text-align: center; border-radius: 30px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 30px 70px -30px rgba(0, 60, 90, .35); animation: rise .6s cubic-bezier(.2,.8,.2,1); }
.login-card .logo { width: 88px; height: 88px; margin-bottom: 18px; filter: drop-shadow(0 14px 22px rgba(0, 131, 184, .35)); }
.login-card .wordmark { font-size: 34px; margin: 2px 0 0; }
.login-card .sub { margin-bottom: 14px; }
.login-card .svp-mark { width: 120px; height: 44px; margin-top: 14px; opacity: .8; }
.login-card.shake { animation: shake .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Panel */
.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; filter: drop-shadow(0 6px 10px rgba(0, 131, 184, .25)); }
.brand strong { font-size: 18px; display: block; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill { font-size: 13px; color: var(--ink-2); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); white-space: nowrap; }
.hero { text-align: center; padding: 50px 0 36px; }
.clock { margin: 8px 0 0; font-size: clamp(60px, 11vw, 108px); font-weight: 200; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; padding: 22px; min-height: 280px; color: inherit; text-decoration: none;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .3s;
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.card:nth-child(2) { animation-delay: .05s; } .card:nth-child(3) { animation-delay: .1s; } .card:nth-child(4) { animation-delay: .15s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hi); border-color: rgba(0, 173, 216, .25); }
.card:active { transform: scale(.985); }
.card:focus-visible { outline: 3px solid rgba(0, 173, 216, .5); outline-offset: 3px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.glyph {
  width: 62px; height: 62px; border-radius: 17px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--a1, #2fc6ea), var(--a2, #0083b8));
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 10px 20px -10px var(--a2, #0083b8);
  font-size: 28px; font-weight: 700; color: #fff;
}
.glyph svg { width: 30px; height: 30px; stroke-width: 1.8; }
.card[data-id="mechanic"] .glyph, .g-mechanic { color: var(--graphite); }
.g-assistant { --a1: #2fc6ea; --a2: #0083b8; } .g-electronics { --a1: #2a7fe0; --a2: #0b3f8c; }
.g-rd { --a1: #5a6270; --a2: #2c3139; } .g-mechanic { --a1: #e4e6ea; --a2: #a9aeb6; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 6px 10px; border-radius: 999px; background: var(--fill); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.status.busy { color: #b86e00; background: rgba(255, 159, 10, .1); }
.status.busy i { background: var(--busy); box-shadow: 0 0 0 3px rgba(255, 159, 10, .2); animation: pulse 1.4s ease-in-out infinite; }
.status.down { color: #d70015; background: rgba(255, 59, 48, .08); }
.status.down i { background: var(--down); }
@keyframes pulse { 50% { opacity: .35; } }
.name { margin: 18px 0 2px; font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
.role { margin: 0; color: var(--ink-3); font-size: 13px; }
.headline { margin: 14px 0 0; color: var(--ink-2); font-size: 14px; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.metrics { display: flex; gap: 0 13px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.metrics dt { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.metrics dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card-foot { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-3); }
.open { display: inline-flex; align-items: center; gap: 2px; color: var(--svp-text); font-weight: 600; font-size: 14px; }
.open svg { width: 16px; height: 16px; transition: transform .25s; }
.card:hover .open svg { transform: translateX(3px); }

.panels { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 20px 22px; min-width: 0; }
.panel h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); min-width: 0; }
.feed li:first-child { border-top: 0; }
.feed .dot { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(160deg, var(--a1, #c7cbd1), var(--a2, #9ba0a8)); }
.feed .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.feed .when { flex: none; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed .bad { color: var(--down); }
.feed .empty { color: var(--ink-3); }
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12px; margin-top: 34px; }
.foot .svp-mark { width: 130px; height: 48px; opacity: .75; }

@media (max-width: 760px) {
  .panels { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 26px; }
  .pill { display: none; }
}

/* Página de error dentro de un subdominio */
body.err { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 480px at 50% -160px, rgba(0, 173, 216, .16), transparent 70%), var(--bg); }
.err-card { width: min(420px, 100%); text-align: center; padding: 36px 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.err-card .glyph { margin: 0 auto 18px; }
.err-card h1 { margin: 0 0 8px; font-size: 24px; }
.err-card p { color: var(--ink-2); margin: 0 0 22px; }
.err-card .btn { color: #fff; background: linear-gradient(180deg, #14b9e2, var(--svp-deep)); }
