/* Laboral Paraguay · Universo Práctico */
:root {
  --bg: #f7f6f2; --surface: #fff; --text: #1d2723; --muted: #4c5a54; --primary: #174c58; --primary-dark: #0e333c;
  --accent: #b4572b; --border: #dcd9cf; --soft: #eef3f2; --ok: #1d6b45; --warn-bg: #fff4e0; --warn-border: #e0a24a; --focus: #1a73e8;
  --radius: 10px; --max: 1040px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11191b; --surface: #182326; --text: #edf2f1; --muted: #b3c0bc; --primary: #7cc4d1; --primary-dark: #a4dae3; --accent: #e59a6c;
    --border: #2a3a3e; --soft: #1d2c30; --ok: #7bd1a0; --warn-bg: #33291a; --warn-border: #8d6a2b; --shadow: none; }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--primary-dark); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-block; padding: 8px 2px; font-weight: 600; font-size: .95rem; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--accent); color: var(--primary-dark); }

/* Texto */
main { padding: 28px 0 56px; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.18; margin: .2em 0 .5em; letter-spacing: -.02em; color: var(--primary-dark); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.25; margin: 2.1em 0 .6em; color: var(--primary-dark); }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
p, li { max-width: 74ch; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 70ch; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0; }
.meta { color: var(--muted); font-size: .92rem; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* Tarjetas */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 18px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; }
.card h3 a { text-decoration: none; color: var(--primary-dark); }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card:hover { border-color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

/* Formularios y resultados */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); margin: 18px 0 8px; }
.tool h2 { margin-top: 0; font-size: 1.3rem; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field legend { font-weight: 650; font-size: .95rem; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
input[type="text"], input[type="date"], input[type="number"], select { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; min-height: 44px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .96rem; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button, .btn { font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 8px; border: 2px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; min-height: 44px; }
@media (prefers-color-scheme: dark) { button, .btn { color: #0b1517; } .btn-ghost { color: var(--primary-dark); } }
button:hover, .btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--primary-dark); }
.btn-ghost:hover { background: var(--soft); color: var(--primary-dark); }
.result { margin-top: 18px; }
.result:empty { display: none; }
.total-box { background: var(--soft); border-left: 5px solid var(--accent); border-radius: 8px; padding: 14px 18px; margin: 6px 0 14px; }
.total-box .label { font-size: .88rem; color: var(--muted); margin: 0; }
.total-box .amount { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 800; color: var(--primary-dark); margin: 0; line-height: 1.2; }
.error { background: #fde8e4; color: #7a1d10; border: 1px solid #e3a094; border-radius: 8px; padding: 10px 14px; }
@media (prefers-color-scheme: dark) { .error { background: #3b1c17; color: #ffd3c9; border-color: #8a4234; } }
.table-wrap { overflow-x: auto; margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 800; background: var(--soft); }
caption { text-align: left; font-weight: 700; padding: 8px 12px; caption-side: top; }
.small-art { display: block; color: var(--muted); font-size: .82rem; }

/* Avisos */
.note, .warning { border-radius: 8px; padding: 12px 16px; margin: 16px 0; max-width: 78ch; font-size: .96rem; }
.note { background: var(--soft); border-left: 4px solid var(--primary); }
.warning { background: var(--warn-bg); border-left: 4px solid var(--warn-border); }
.note p, .warning p { margin: .3em 0; }
.law { border-left: 3px solid var(--border); padding: 2px 0 2px 14px; color: var(--muted); font-size: .95rem; margin: 12px 0; max-width: 72ch; }
.law cite { display: block; font-style: normal; font-weight: 700; font-size: .85rem; margin-top: 4px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; margin: 18px 0; max-width: 560px; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; margin: 8px 0; max-width: 78ch; }
summary { cursor: pointer; font-weight: 650; }
.updated { display: inline-block; background: var(--soft); border-radius: 999px; padding: 3px 12px; font-size: .85rem; color: var(--muted); }

/* Pie */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 30px 0; font-size: .92rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: .95rem; margin: 0 0 8px; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .legal { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; max-width: none; }

@media print {
  .site-header, .site-footer, .actions, .skip, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .tool { border: 0; box-shadow: none; padding: 0; }
}
