/* Mi Garaje R2 — app para clientes. Móvil primero. */
:root {
  --a: #ff6600; --a-h: #e05600; --a-bg: rgba(255, 102, 0, .1);
  --bg: #f5f4f1; --card: #ffffff; --bg2: #efede8; --bdr: #e4e1da;
  --t1: #18181b; --t2: #52525b; --t3: #8a8a93;
  --ok: #15803d; --ok-bg: #dcfce7; --wn: #b45309; --wn-bg: #fef3c7; --er: #b91c1c; --er-bg: #fee2e2;
  --wa: #128c7e;
  --shd: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --tabs-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111; --card: #1c1c1c; --bg2: #262626; --bdr: #333333;
    --t1: #f3f3f3; --t2: #c4c4c8; --t3: #8f8f96;
    --ok: #4ade80; --ok-bg: rgba(74,222,128,.14); --wn: #fbbf24; --wn-bg: rgba(251,191,36,.14); --er: #f87171; --er-bg: rgba(248,113,113,.14);
    --wa: #25d366; --shd: 0 1px 3px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --card: #1c1c1c; --bg2: #262626; --bdr: #333333;
  --t1: #f3f3f3; --t2: #c4c4c8; --t3: #8f8f96;
  --ok: #4ade80; --ok-bg: rgba(74,222,128,.14); --wn: #fbbf24; --wn-bg: rgba(251,191,36,.14); --er: #f87171; --er-bg: rgba(248,113,113,.14);
  --wa: #25d366; --shd: 0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', system-ui, sans-serif; background: var(--bg); color: var(--t1); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.gj-noscroll { overflow: hidden; }
[hidden] { display: none !important; }
h1 { font-size: 21px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 4px 0 10px; }
h3 { font-size: 15px; margin: 0 0 2px; }
a { color: var(--a); }
p { margin: 6px 0; }

/* Logo según tema */
.gj-logo { height: 32px; width: auto; display: block; }
.gj-logo-d { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gj-logo-l { display: none; } :root:not([data-theme="light"]) .gj-logo-d { display: block; } }
:root[data-theme="dark"] .gj-logo-l { display: none; }
:root[data-theme="dark"] .gj-logo-d { display: block; }

/* Controles */
.gj-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--t2); margin: 12px 0 4px; }
.gj-inp { width: 100%; font: inherit; font-size: 16px; color: var(--t1); background: var(--card); border: 1.5px solid var(--bdr); border-radius: 11px; padding: 10px 12px; outline: none; }
.gj-inp:focus { border-color: var(--a); }
.gj-inp-big { font-size: 24px; font-weight: 600; text-align: center; }
.gj-up { text-transform: uppercase; }
textarea.gj-inp { resize: vertical; }
.gj-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; border: 1.5px solid var(--bdr); background: var(--card); color: var(--t1); border-radius: 11px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.gj-btn:disabled { opacity: .55; cursor: not-allowed; }
.gj-btn-pri { background: var(--a); border-color: var(--a); color: #fff; }
.gj-btn-pri:hover:not(:disabled) { background: var(--a-h); }
.gj-btn-sec { color: var(--a); border-color: var(--a); }
.gj-btn-danger { color: var(--er); border-color: var(--er); }
.gj-btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.gj-btn-sm { font-size: 13px; padding: 6px 12px; min-height: 36px; }
.gj-btn-full { width: 100%; margin-top: 14px; }
.gj-link { font: inherit; background: none; border: none; color: var(--a); font-weight: 600; cursor: pointer; padding: 4px 0; }
.gj-icon-btn { background: none; border: 0; font-size: 20px; color: var(--t2); cursor: pointer; width: 40px; height: 40px; }
.gj-chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--t2); margin-top: 14px; cursor: pointer; }
.gj-chk input { width: 20px; height: 20px; accent-color: var(--a); flex-shrink: 0; margin-top: 1px; }
.gj-chk .gj-link { padding: 0; display: inline; }
.gj-muted { color: var(--t3); font-size: 13px; }
.gj-small { font-size: 12px; }
.gj-center { text-align: center; }
.gj-vacio { text-align: center; color: var(--t3); padding: 28px 12px; }
.gj-acc { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.gj-mr { margin-right: auto; }
.gj-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.gj-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.gj-tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 10px; background: var(--bg2); color: var(--t2); white-space: nowrap; }
.gj-tag-ok { background: var(--ok-bg); color: var(--ok); }
.gj-tag-wn { background: var(--wn-bg); color: var(--wn); }
.gj-tag-er { background: var(--er-bg); color: var(--er); }
.gj-file { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.gj-file input { font: inherit; font-size: 13px; }

/* Ingreso */
.gj-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.gj-auth-box { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 24px; box-shadow: var(--shd); }
.gj-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; font-weight: 700; color: var(--a); }
.gj-brand .gj-logo { height: 52px; }
.gj-sep { display: flex; align-items: center; gap: 10px; color: var(--t3); font-size: 12px; margin: 18px 0 0; }
.gj-sep::before, .gj-sep::after { content: ''; flex: 1; border-top: 1px solid var(--bdr); }
.gj-politica { font-size: 13px; color: var(--t2); max-height: 55vh; overflow-y: auto; }

/* Marco de la app */
.gj-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--bg); border-bottom: 1px solid var(--bdr); }
.gj-top-t { flex: 1; font-weight: 700; color: var(--a); padding-left: 8px; border-left: 1px solid var(--bdr); }
.gj-main { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); }
.gj-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--bdr); padding-bottom: env(safe-area-inset-bottom); }
.gj-tabs button { flex: 1; height: var(--tabs-h); background: none; border: 0; font: inherit; font-size: 11px; font-weight: 600; color: var(--t3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.gj-tabs button span { font-size: 20px; line-height: 1; }
.gj-tabs button.act { color: var(--a); }

/* Tarjetas */
.gj-card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--bdr); border-radius: 16px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shd); }
button.gj-card { cursor: pointer; }
.gj-card-btn { display: block; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; margin-bottom: 10px; }
.gj-sec { margin-top: 22px; }
.gj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gj-head h1 { margin: 0; }
.gj-hola { margin-bottom: 10px; }
.gj-hero { text-align: center; padding: 22px 18px; }
.gj-hero-ico { font-size: 42px; }
.gj-ok-card { color: var(--ok); background: var(--ok-bg); border-color: transparent; font-weight: 500; }
.gj-aviso { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.gj-aviso .gj-muted { grid-column: 1; }
.gj-aviso .gj-btn { grid-column: 2; grid-row: 1 / span 2; }
.gj-km-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gj-km-card b { font-size: 18px; }

/* Nivel */
.gj-nivel { background: linear-gradient(135deg, #3f3f46, #18181b); color: #fff; border-radius: 16px; padding: 14px 16px; }
.gj-nivel-1 { background: linear-gradient(135deg, #94a3b8, #475569); }
.gj-nivel-2 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.gj-nivel-3 { background: linear-gradient(135deg, #ff6600, #7c2d12); }
.gj-nivel-0 { background: linear-gradient(135deg, #b87333, #6b3e1d); }
.gj-nivel-top { display: flex; justify-content: space-between; align-items: baseline; }
.gj-nivel-top b { font-size: 16px; }
.gj-barra { height: 7px; border-radius: 6px; background: rgba(255,255,255,.25); margin: 9px 0 6px; overflow: hidden; }
.gj-barra i { display: block; height: 100%; background: #fff; border-radius: 6px; }
.gj-nivel .gj-muted { color: rgba(255,255,255,.8); font-size: 12px; }

/* Pendientes */
.gj-pend { display: flex; gap: 12px; }
.gj-pend-ico { font-size: 22px; }
.gj-pend-txt { flex: 1; min-width: 0; }
.gj-pend-urg { border-left: 4px solid var(--a); }
.gj-pend-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Motos */
.gj-motos-mini { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.gj-moto-mini { scroll-snap-align: start; background: var(--card); border: 1px solid var(--bdr); border-radius: 14px; padding: 0 0 10px; font: inherit; color: inherit; text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.gj-moto-mini img, .gj-moto-mini .gj-moto-ph { width: 100%; height: 92px; object-fit: cover; }
.gj-moto-mini b, .gj-moto-mini small { padding: 0 10px; }
.gj-moto-mini b { margin-top: 8px; font-size: 13px; }
.gj-moto-mini small { color: var(--t3); font-size: 11px; }
.gj-moto-ph { display: flex; align-items: center; justify-content: center; background: var(--bg2); font-size: 30px; }
.gj-moto { display: flex; gap: 12px; align-items: center; }
.gj-moto img, .gj-moto .gj-moto-ph { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.gj-moto .gj-tag { margin-top: 5px; }
.gj-back { margin-bottom: 6px; }
.gj-moto-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.gj-moto-head img, .gj-moto-head .gj-moto-ph { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; flex-shrink: 0; }
.gj-moto-head h1 { margin: 0; }
.gj-placa { display: inline-block; margin-top: 6px; background: #facc15; color: #111; font-weight: 700; letter-spacing: 1.5px; border: 2px solid #111; border-radius: 6px; padding: 1px 10px; font-size: 14px; }
.gj-seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; margin: 14px 0 12px; }
.gj-seg button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--t2); padding: 9px 4px; border-radius: 9px; cursor: pointer; }
.gj-seg button.act { background: var(--card); color: var(--a); box-shadow: var(--shd); }
.gj-doc { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.gj-doc > div { flex: 1; min-width: 0; }
.gj-doc-falta { border-style: dashed; box-shadow: none; }
.gj-clip { font-size: 14px; }
.gj-rec { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.gj-rec > .gj-muted { text-align: right; font-size: 12px; }
.gj-off { opacity: .55; }
.gj-sugeridos { display: flex; flex-wrap: wrap; gap: 8px; }
.gj-chip { display: inline-block; text-decoration: none; background: var(--a-bg); color: var(--a); font-weight: 600; font-size: 13px; border-radius: 20px; padding: 7px 14px; }
.gj-acc-moto { justify-content: space-between; margin-top: 26px; }

/* Hoja de vida */
.gj-timeline { position: relative; padding-left: 16px; border-left: 2px solid var(--bdr); margin-left: 6px; }
.gj-tl { position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--bdr); border-radius: 14px; padding: 11px 13px; margin-bottom: 10px; cursor: pointer; }
.gj-tl::before { content: ''; position: absolute; left: -24px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--a); border: 2px solid var(--bg); }
.gj-tl-f { font-size: 12px; color: var(--t3); font-weight: 600; }
.gj-r2 { font-style: normal; font-size: 10px; background: var(--a); color: #fff; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }

/* Comunidad */
.gj-evento img { width: calc(100% + 28px); margin: -14px -14px 10px; height: 150px; object-fit: cover; border-radius: 16px 16px 0 0; display: block; }
.gj-ev-fecha { font-size: 12px; font-weight: 700; color: var(--a); }
.gj-ev-fecha::first-letter { text-transform: uppercase; }
.gj-ev-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.gj-ben { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gj-codigo { font-family: ui-monospace, monospace; font-size: 32px; font-weight: 700; letter-spacing: 5px; text-align: center; background: var(--a-bg); color: var(--a); border-radius: 14px; padding: 18px 10px; margin: 12px 0; }
.gj-codigo-sm { font-size: 22px; padding: 10px; }
.gj-lista { margin-top: 12px; }
.gj-fila { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bdr); }
.gj-fila span { display: flex; flex-direction: column; }
.gj-fila small { color: var(--t3); font-size: 11px; }
.gj-r2c-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.gj-r2c .gj-btn, .gj-r2c .gj-tag { margin-top: 8px; }

/* Cuenta */
.gj-lista-btn { padding: 4px 0; }
.gj-lista-btn > button, .gj-lista-btn > a { display: block; width: 100%; text-align: left; font: inherit; color: var(--t1); text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--bdr); padding: 13px 14px; cursor: pointer; }
.gj-lista-btn > :last-child { border-bottom: 0; }
.gj-lista-btn > button:disabled { color: var(--t3); }
.gj-borrar { display: block; margin: 22px auto 0; color: var(--er); font-weight: 500; font-size: 13px; }

/* Hoja inferior */
.gj-sheet-ov { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.gj-sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: gjSube .18s ease-out; }
@keyframes gjSube { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .gj-sheet-ov { align-items: center; } .gj-sheet { border-radius: 22px; } }

.gj-toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60; max-width: calc(100% - 32px); background: #18181b; color: #fff; font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; }
.gj-toast.on { opacity: 1; transform: translate(-50%, 0); }
.gj-toast.err { background: var(--er); }
.gj-toast.ok { background: var(--ok); }
:root[data-theme="dark"] .gj-toast.ok, :root[data-theme="dark"] .gj-toast.err { color: #111; }

@media (max-width: 380px) { .gj-grid3 { grid-template-columns: 1fr 1fr; } }
