/* Panel de SIK Refrigeración — pensado para usarse desde el celular */
:root {
  --ink: #121a22; --ink-3: #26333f; --ice: #f4f7fa; --frost: #e7eff5; --line: #d8e2ea;
  --muted: #586776; --red: #e8521b; --red-2: #cf4410; --cold: #1c86c9; --ok: #1f9d6b; --bad: #c8331f;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--ice); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-family: var(--display); letter-spacing: -.02em; line-height: 1.1; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s; }
.btn:hover { border-color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .86rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn:disabled { opacity: .55; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.field em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .84rem; }
.field input, .field textarea, .photo input, .op input, .op textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 11px 13px; font-size: 16px; font-weight: 500; }
.field input:focus, .field textarea:focus, .photo input:focus, .op input:focus, .op textarea:focus { outline: none; border-color: var(--cold); }
textarea { resize: vertical; }
.msg { min-height: 1.4em; font-size: .9rem; font-weight: 600; color: var(--muted); }
.msg.is-error { color: var(--bad); }
.msg.is-ok { color: var(--ok); }

/* Ingreso */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login__box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px; display: grid; gap: 14px; text-align: center; box-shadow: 0 30px 60px -40px rgba(18, 26, 34, .45); }
.login__logo { width: 96px; height: auto; margin: 0 auto; }
.login__box h1 { font-size: 1.5rem; }
.login__box > p:not(.msg) { color: var(--muted); font-size: .95rem; }
.login__box .field { text-align: left; }
.login__back { color: var(--muted); font-size: .9rem; }

/* Barra de arriba */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: 12px 16px 0; }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 900px; margin: 0 auto; }
.top__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top__brand img { width: 40px; height: auto; background: #fff; border-radius: 10px; padding: 3px; flex: none; }
.top__brand strong { display: block; font: 700 1.02rem var(--display); white-space: nowrap; }
.top__brand small { color: #9fb0bf; font-size: .78rem; }
.top__actions { display: flex; gap: 8px; }
.top .btn { white-space: nowrap; background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.top .btn:hover { border-color: #fff; }
.tabs { display: flex; gap: 4px; max-width: 900px; margin: 12px auto 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; padding: 12px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: #9fb0bf; font-weight: 700; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.tab.is-active { color: #fff; border-bottom-color: var(--red); }

/* Paneles */
.pane { max-width: 900px; margin: 0 auto; padding: 22px 16px 120px; display: grid; gap: 14px; }
.pane__title { font-size: 1.5rem; }
.pane__title small { font: 600 .95rem var(--sans); color: var(--muted); letter-spacing: 0; }
.pane__help { color: var(--muted); font-size: .95rem; }
.form { display: grid; gap: 14px; max-width: 460px; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(244, 247, 250, 0), var(--ice) 35%); }
.savebar .btn { max-width: 868px; margin: 0 auto; display: flex; box-shadow: 0 16px 30px -16px rgba(232, 82, 27, .8); }
.savebar .btn.is-dirty::after { content: "•"; font-size: 1.4rem; line-height: 0; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.photo__img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--frost); }
.photo__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo__n { position: absolute; left: 8px; top: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: rgba(18, 26, 34, .8); color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.photo__tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }
.tool { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); font-weight: 700; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .5); }
.tool:disabled { opacity: .35; cursor: default; }
.tool--rm { color: var(--bad); }
.photo input { border: 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 15px; padding: 10px 12px; }
.photo--loading { aspect-ratio: 4 / 3.9; display: grid; place-items: center; gap: 8px; align-content: center; color: var(--muted); font-size: .88rem; font-weight: 600; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cold); animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.upload { position: relative; display: grid; place-items: center; min-height: 64px; border: 2px dashed var(--line); border-radius: 16px; background: #fff; font-weight: 700; cursor: pointer; }
.upload:hover { border-color: var(--cold); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Opiniones */
.ops { display: grid; gap: 12px; }
.op { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.op__head { display: flex; align-items: center; gap: 8px; }
.op__head input { flex: 1; min-width: 0; font-weight: 700; }
.op .tool { background: var(--frost); box-shadow: none; flex: none; }
.op__count { justify-self: end; color: var(--muted); font-size: .8rem; margin-top: -4px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 16px; }

.toast { position: fixed; left: 50%; bottom: 92px; z-index: 40; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .top__brand small { display: none; }
  .photos { grid-template-columns: 1fr 1fr; }
}
