/* Layout: una columna en móvil, dos en escritorio. Estilo "liquid glass" claro: fondo blanco con
   manchas suaves de café y azul, tarjetas de cristal translúcido. Tema claro fijo, elegido a propósito. */
:root {
  --bg: #f6f7f9;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .85);
  --hairline: rgba(60, 45, 30, .10);
  --ink: #1f1813;
  --muted: #6e6359;
  --coffee: #6b4226;
  --coffee-strong: #4e2e18;
  --coffee-soft: rgba(107, 66, 38, .09);
  --blue: #2f6fb6;
  --blue-soft: rgba(47, 111, 182, .10);
  --ok: #24804f;
  --ok-soft: rgba(36, 128, 79, .11);
  --err: #b23a2e;
  --err-soft: rgba(178, 58, 46, .10);
  --blob-coffee: rgba(176, 120, 70, .30);
  --blob-blue: rgba(80, 150, 230, .28);
  --shadow: 0 10px 30px rgba(40, 30, 20, .08), 0 1px 2px rgba(40, 30, 20, .06);
  --font: system-ui, -apple-system, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, "SF Pro Display", system-ui, "Inter", "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--font); min-height: 100%;
  background-image:
    radial-gradient(38rem 30rem at 8% -6%, var(--blob-coffee), transparent 70%),
    radial-gradient(34rem 28rem at 96% 8%, var(--blob-blue), transparent 70%),
    radial-gradient(40rem 30rem at 60% 105%, rgba(176, 120, 70, .16), transparent 70%);
  background-attachment: fixed;
}

a { color: var(--blue); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.18; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.16rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(47, 111, 182, .45); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1000px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
@media (min-width: 780px) {
  .grid.side { grid-template-columns: 1.45fr 1fr; align-items: start; }
  .grid.two { grid-template-columns: 1fr 1fr; align-items: start; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

/* Cristal */
.glass, .card, .top {
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
}

/* Cabecera de la app */
.top { position: relative; z-index: 20; background: rgba(255, 255, 255, .58); border-bottom: 1px solid var(--glass-border); box-shadow: 0 1px 0 var(--hairline); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; line-height: 1.1; background: none; border: 0; color: var(--coffee-strong); cursor: pointer; text-align: left; padding: 0; display: flex; gap: 10px; align-items: center; }
.brand .dot { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(140deg, var(--coffee), #a8743f 55%, var(--blue)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); flex: none; }
.brand small { display: block; font-family: var(--font); font-weight: 600; font-size: .72rem; color: var(--blue); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav button { background: transparent; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 550; }
.nav button:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.nav button[aria-current="page"] { color: var(--coffee-strong); background: var(--glass-strong); box-shadow: var(--shadow); }

.hero .wrap { padding-block: 30px 6px; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); color: var(--coffee-strong); }
.hero p { color: var(--muted); margin-top: 6px; max-width: 34em; }
.hero .accent { color: var(--blue); }
main.wrap { padding-block: 22px 48px; }
.narrow { max-width: 600px; margin-inline: auto; }

.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.9); padding: 22px; display: flex; flex-direction: column; gap: 12px;
}
.card.flat { background: rgba(255,255,255,.38); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.card.ok-ring { border-color: rgba(36,128,79,.45); box-shadow: var(--shadow), 0 0 0 3px var(--ok-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(180deg, #7c4f2f, var(--coffee-strong)); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 11px 20px; font-weight: 650; cursor: pointer; min-height: 44px; box-shadow: 0 6px 16px rgba(78,46,24,.22), inset 0 1px 0 rgba(255,255,255,.25); }
.btn:hover { filter: brightness(1.08); }
.btn.big { width: 100%; font-size: 1.04rem; padding: 14px 20px; }
.btn.ghost { background: rgba(255,255,255,.65); color: var(--coffee-strong); border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 #fff; }
.btn.blue { background: linear-gradient(180deg, #3b80c9, #275e9c); }
.btn.sm { min-height: 34px; padding: 6px 13px; font-size: .86rem; }
.btn.ok { background: linear-gradient(180deg, #2e9560, var(--ok)); }
.btn.danger { background: linear-gradient(180deg, #c64a3d, var(--err)); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-weight: 650; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .86rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=time], select.in, textarea {
  width: 100%; background: rgba(255,255,255,.75); border: 1px solid var(--hairline); border-radius: 14px; padding: 11px 13px;
  box-shadow: inset 0 1px 2px rgba(40,30,20,.05);
}
input:focus, select.in:focus, textarea:focus { outline: none; border-color: rgba(47,111,182,.55); box-shadow: 0 0 0 4px var(--blue-soft); background: #fff; }
input:disabled { color: var(--muted); }
textarea { min-height: 100px; resize: vertical; }
input[type=file] { font-size: .9rem; }
.pin { letter-spacing: .4em; font-size: 1.3rem; text-align: center; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 19px; height: 19px; accent-color: var(--coffee); }
details > summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: .9rem; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; }
details[open] > summary::before { content: "− "; }

.flash { border-radius: 16px; padding: 11px 15px; font-weight: 550; border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.flash.ok { background: var(--ok-soft); color: #175c37; }
.flash.error { background: var(--err-soft); color: #7e2018; }
.flash.info { background: var(--blue-soft); color: #1f4f86; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--muted); border: 1px solid var(--hairline); white-space: nowrap; }
.badge.wrapok { white-space: normal; }
.card > .badge, .stack > .badge { align-self: flex-start; }
.badge.sel, .badge.abierto { background: var(--ok-soft); color: #175c37; border-color: transparent; }
.badge.proximo { background: var(--blue-soft); color: #1f4f86; border-color: transparent; }
.badge.revision { background: var(--coffee-soft); color: var(--coffee-strong); border-color: transparent; }

.credits { display: flex; align-items: baseline; gap: 6px; }
.credits .n { font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; color: var(--coffee-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.credit-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); font-weight: 650; color: var(--coffee-strong); }
.credit-chip b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.beans { display: grid; grid-template-columns: repeat(13, 1fr); gap: 5px; }
.beans i { aspect-ratio: 1 / 1.3; border-radius: 50%; background: rgba(47,111,182,.12); position: relative; box-shadow: inset 0 1px 1px rgba(255,255,255,.6); }
.beans i.on { background: linear-gradient(160deg, #8a5a35, var(--coffee-strong)); }
.beans i.new { background: linear-gradient(160deg, #4a8fd6, var(--blue)); }
.beans i::after { content: ""; position: absolute; left: 47%; top: 18%; bottom: 18%; width: 1.5px; border-radius: 2px; background: #fff; opacity: .5; transform: rotate(12deg); }

/* Pantalla de propuesta enviada */
.sent { text-align: center; align-items: center; padding-block: 34px; }
.sent .tick { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 2rem; font-weight: 800; border: 1px solid rgba(36,128,79,.25); }
.sent .plus { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; color: var(--blue); line-height: 1; }
.sent .beans { width: 100%; max-width: 420px; }
@media (prefers-reduced-motion: no-preference) {
  .sent .plus { animation: rise .6s cubic-bezier(.2,.9,.3,1.2); }
  .beans i.new { animation: pulse 1.2s ease-out 2; }
  .flash { animation: pop .25s ease-out; }
  @keyframes rise { from { transform: translateY(12px) scale(.8); opacity: 0; } }
  @keyframes pulse { 50% { transform: scale(1.25); } }
  @keyframes pop { from { transform: translateY(-4px); opacity: .6; } }
}

.example { background: rgba(255,255,255,.5); border: 1px dashed rgba(47,111,182,.35); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.example dt { font-size: .72rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--blue); margin-top: 8px; }
.example dt:first-child { margin-top: 0; }
.example dd { margin: 2px 0 0; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.list li:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.linklike { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 650; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; text-underline-offset: 2px; }

.stat { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--coffee-strong); }
.stat-label { color: var(--muted); font-size: .84rem; }

.prop { border: 1px solid var(--glass-border); border-radius: 18px; padding: 18px; background: var(--glass); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.prop.sel { border-color: rgba(36,128,79,.5); box-shadow: var(--shadow), 0 0 0 3px var(--ok-soft); }
.prop .k { font-size: .72rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--blue); margin-top: 8px; }
.prop .v { white-space: pre-wrap; }
.prop img { border-radius: 12px; max-height: 260px; width: auto; margin-top: 8px; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--coffee); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: .8em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; background: rgba(255,255,255,.7); border: 1px solid var(--hairline); padding: 6px 8px; border-radius: 8px; }
.thumb { max-width: 140px; border-radius: 10px; margin-top: 6px; }
.anon { flex-direction: row; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, rgba(47,111,182,.13), rgba(255,255,255,.7)); border-color: rgba(47,111,182,.30); }
.anon .ico { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(47,111,182,.3); }
.anon h2 { color: #1f4f86; }
.anon p { margin-top: 4px; }
.tiny { width: 76px !important; display: inline-block; text-align: center; padding: 8px 6px !important; }
.tiny.time { width: 110px !important; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 29px; color: var(--muted); }
fieldset.opt { border: 1px solid var(--hairline); border-radius: 16px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: rgba(255,255,255,.4); min-width: 0; }
fieldset.opt legend { font-weight: 700; padding: 0 6px; color: var(--coffee-strong); }
input[type=radio] { width: 19px; height: 19px; accent-color: var(--coffee); }
.notice-glass { background: var(--blue-soft); border: 1px solid rgba(47,111,182,.2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: #1f3f66; }
.ptable td { padding: 6px 6px; vertical-align: middle; }
.ptable input { padding: 8px 10px; min-width: 150px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 4px; }
@media (max-width: 600px) { .add-row { grid-template-columns: 1fr; } }
.mail-body { white-space: pre-wrap; background: rgba(255,255,255,.75); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; margin-top: 6px; color: var(--ink); }
.brand .logo { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; align-self: stretch; background: rgba(60,45,30,.18); margin: 2px 2px; }
@media (max-width: 420px) { .brand .logo { height: 28px; } }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding-block: 0 28px; }

/* Extras de la app del servidor */
.top a.brand { text-decoration: none; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 999px; font-size: .9rem; font-weight: 550; text-decoration: none; }
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.nav a.on { color: var(--coffee-strong); background: var(--glass-strong); box-shadow: var(--shadow); }
a.btn { text-decoration: none; }
form.inline { display: inline; }
.pin { letter-spacing: .4em; font-size: 1.3rem; text-align: center; }
