[hidden] { display: none !important; }

:root {
  --ink: #16222e;
  --ink-2: #4a5a68;
  --line: #d7dfe6;
  --bg: #f5f7f9;
  --card: #ffffff;
  --brand: #1f3b57;
  --brand-2: #2e5b7a;
  --accent: #b0562a;
  --ok: #2f7d52;
  --warn: #b3702a;
  --bad: #a83a3a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 34, 46, .07), 0 8px 24px rgba(22, 34, 46, .06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.top {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  padding: 16px clamp(14px, 4vw, 28px); background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 34px; height: 34px; color: var(--brand); }
.top h1 { margin: 0; font-size: 19px; letter-spacing: .2px; color: var(--brand); }
.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); max-width: 52ch; }
.top-actions { display: flex; gap: 8px; }

button { font: inherit; cursor: pointer; }
.ghost, .primary, .chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 8px 13px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
}
.ghost:hover, .chip-btn:hover { background: #eef3f7; }
.ghost svg { width: 17px; height: 17px; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.primary:hover { background: #1a3348; }
.primary[disabled] { opacity: .5; cursor: not-allowed; }
.small { padding: 6px 10px; font-size: 13px; }
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-bad { color: var(--bad); }

main { max-width: 1180px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 26px) 60px; }

.drop {
  background: var(--card); border: 1.5px dashed var(--brand-2); border-radius: var(--radius);
  padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.drop.over { border-color: var(--accent); background: #fdf6f1; }
.drop-icon { width: 30px; height: 30px; color: var(--brand-2); }
.drop p { margin: 6px 0; }
.hint { font-size: 12.5px; color: var(--ink-2); }
.progress { margin-top: 14px; }
.bar { height: 6px; border-radius: 6px; background: #e6ecf1; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0%; background: var(--brand-2); transition: width .2s ease; }
#progress-text { font-size: 12.5px; color: var(--ink-2); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 12px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; color: var(--ink-2);
}
.tab svg { width: 17px; height: 17px; }
.tab.active { color: var(--brand); border-color: var(--brand); background: #eef4f9; font-weight: 600; }
.count { background: #e3ebf2; color: var(--brand); border-radius: 999px; padding: 0 7px; font-size: 12px; }

.panel { display: grid; gap: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; }
.card h2, .card h3 { margin: 0 0 6px; font-size: 16px; color: var(--brand); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--ink-2); background: #f7fafc; }
.badge.kind { text-transform: uppercase; letter-spacing: .4px; color: var(--brand); background: #eef4f9; border-color: #cfdeea; }
.badge.warn { color: var(--warn); background: #fdf5ec; border-color: #f0dcc0; }
.badge.err { color: var(--bad); background: #fcefef; border-color: #f0cfcf; }
.muted { color: var(--ink-2); font-size: 13px; }
.path { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-all; }

ul.bullets { margin: 8px 0 0; padding-left: 20px; }
ul.bullets li { margin: 4px 0; }
ul.bullets li::marker { color: var(--brand-2); }
.nested { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

.cal-month { margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.cal-dow { font-size: 11px; color: var(--ink-2); text-align: center; }
.cal-day { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: #fbfdfe; font-size: 12px; }
.cal-day.empty { border-style: dashed; background: transparent; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(176, 86, 42, .25); }
.cal-day .num { font-weight: 700; color: var(--ink-2); }
.cal-item { display: block; width: 100%; text-align: left; border: 0; background: #eef4f9; color: var(--brand); border-radius: 6px; padding: 3px 6px; margin-top: 4px; font-size: 11.5px; line-height: 1.3; }
.cal-item.informe { background: #f3ecdf; color: #7a5322; }
.cal-item.reunion { background: #e9f2ee; color: #2f6b4f; }
.cal-item.vencida { background: #f8e9e9; color: #8f3636; }

.task-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.task-list li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: start; border-bottom: 1px solid #eff3f6; padding-bottom: 8px; }
.task-when { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.task-when small { display: block; color: var(--ink-2); font-weight: 400; }
.task-title { font-size: 14px; }
.task-meta { color: var(--ink-2); font-size: 12px; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #f7fafc; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.chip b { color: var(--brand); }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
table.data th, table.data td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.data th { background: #eef4f9; color: var(--brand); }

.report-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select, input[type=text], input[type=date], input[type=number], textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; }
.field { margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.check input { width: auto; }

.editor-shell { background: #e9edf1; border-radius: var(--radius); padding: clamp(8px, 2vw, 20px); }
.editor {
  background: #fff; max-width: 820px; margin: 0 auto; padding: 42px clamp(18px, 5vw, 48px);
  border-radius: 4px; box-shadow: 0 2px 14px rgba(22, 34, 46, .12); min-height: 320px; outline: none;
  font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.65; color: #1c1c1c;
}
.editor:focus { box-shadow: 0 0 0 2px rgba(46, 91, 122, .35), 0 2px 14px rgba(22, 34, 46, .12); }
.editor h1 { font-size: 27px; color: var(--brand); text-align: center; margin: 0 0 8px; }
.editor h2 { font-size: 20px; color: var(--brand); margin-top: 28px; border-bottom: 1px solid #d8e0e7; padding-bottom: 5px; }
.editor h3 { font-size: 16.5px; color: var(--brand-2); margin-top: 20px; }
.editor p.meta { text-align: center; color: var(--ink-2); font-size: 13.5px; margin-bottom: 28px; font-family: inherit; }
.editor p.r-sign { margin-top: 30px; }
.editor table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; font-family: system-ui, sans-serif; }
.editor th, .editor td { border: 1px solid #c9d4de; padding: 6px 8px; text-align: left; }
.editor th { background: #eef4f9; }
.editor blockquote { border-left: 3px solid #9bb3c4; margin: 12px 0; padding: 3px 14px; color: #3b4c5c; font-style: italic; }
.editor hr.page-break { border: 0; border-top: 1px dashed #b9c6d2; margin: 22px 0; }
.editor ul, .editor ol { padding-left: 22px; }
.editor li { margin: 4px 0; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.stats b { color: var(--brand); }

.callout { border-left: 3px solid var(--accent); background: #fdf6f1; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.callout.info { border-color: var(--brand-2); background: #eef4f9; }

.modal-layer {
  position: fixed; inset: 0; background: rgba(22, 34, 46, .45); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 60;
}
.modal-card {
  background: var(--card); border-radius: var(--radius); max-width: 660px; width: 100%; max-height: 88vh; overflow: auto;
  padding: 20px 22px 22px; position: relative; box-shadow: 0 18px 50px rgba(10, 20, 30, .3);
}
.modal-x {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: grid; place-items: center;
}
.modal-x:hover { color: var(--bad); border-color: #e2c5c5; }
.modal-card h2 { margin: 0 34px 10px 0; font-size: 17px; color: var(--brand); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--brand);
  color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow); z-index: 70;
}
.footnote { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 22px; }

@media (max-width: 640px) {
  .top { flex-direction: column; gap: 10px; }
  .top-actions { width: 100%; }
  .tagline { display: none; }
  .cal-day { min-height: 58px; font-size: 11px; }
  .task-list li { grid-template-columns: 1fr; gap: 2px; }
  .editor { padding: 26px 18px; }
}
