* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f4f6f9; color: #1c2733; }
h1 { font-size: 1.2rem; } h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: #16324f; color: #fff; padding: .7rem 1rem; }
header nav { display: flex; gap: .8rem; flex-wrap: wrap; margin-left: auto; }
header a { color: #bcd2e8; text-decoration: none; font-size: .9rem; }
header a.active, header a:hover { color: #fff; }
main { max-width: 1150px; margin: 1rem auto; padding: 0 1rem; }
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.card { background: #fff; padding: 2rem; border-radius: 10px; width: 340px; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.card form { display: grid; gap: .6rem; margin-top: 1rem; }
label { font-size: .85rem; color: #445; }
input, select, textarea { padding: .55rem; border: 1px solid #c6cfda; border-radius: 6px; font-size: .92rem; width: 100%; }
button { background: #1d5fa8; color: #fff; border: 0; border-radius: 6px; padding: .55rem 1rem; cursor: pointer; font-size: .9rem; }
button:hover { background: #174d87; }
button:disabled { background: #9db4cc; cursor: default; }
.btn-cancel, .btn-soft { background: #e3e9f0; color: #234; }
.error { color: #b00020; font-size: .88rem; } .muted { color: #667; font-size: .85rem; }
.badge { background: #dde7f2; border-radius: 10px; padding: .1rem .5rem; font-size: .8rem; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.counter { background: #fff; border-radius: 10px; padding: .9rem; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.counter:hover { border-color: #1d5fa8; }
.counter .num { font-size: 1.6rem; font-weight: 700; }
.counter .lbl { font-size: .85rem; color: #556; }
.proximas { list-style: none; background: #fff; border-radius: 10px; padding: .4rem .9rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.proximas li { padding: .5rem 0; border-bottom: 1px solid #edf1f6; display: flex; gap: .8rem; align-items: baseline; font-size: .92rem; }
.proximas li:last-child { border-bottom: 0; }
.proximas .fecha { color: #1d5fa8; font-weight: 600; white-space: nowrap; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.filters input { flex: 2 1 240px; }
.filters select { flex: 1 1 140px; width: auto; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid #edf1f6; white-space: nowrap; }
th { background: #f0f4f9; position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #eef4fb; }
.pill { display: inline-block; border-radius: 10px; padding: .05rem .5rem; font-size: .78rem; }
.p-Nuevo { background: #e8eefc; color: #24478f; } .p-Posible { background: #e7f6ec; color: #1c6b38; }
.p-En { background: #fdf3e2; color: #92580a; } .p-No { background: #fbe4e4; color: #9c2424; }
.p-Cerrado { background: #ececf1; color: #556; }
.ficha-top { display: flex; gap: .6rem; margin-bottom: .8rem; }
.resumen { background: #16324f; color: #fff; border-radius: 10px; padding: .8rem 1rem; margin-bottom: .8rem; font-size: .9rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.resumen b { color: #ffd479; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.panel { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.panel h3 { font-size: .95rem; margin-bottom: .6rem; }
.panel form, .nota-form { display: grid; gap: .5rem; }
.historial { max-height: 260px; overflow-y: auto; font-size: .88rem; }
.historial .item { border-bottom: 1px solid #edf1f6; padding: .45rem 0; }
.historial .fecha { color: #889; font-size: .78rem; }
.web-preview { width: 100%; height: 320px; border: 1px solid #c6cfda; border-radius: 6px; margin-top: .5rem; }
.otros { font-size: .85rem; color: #456; margin: .3rem 0; }
.otros a { color: #1d5fa8; }
.modal { position: fixed; inset: 0; background: rgba(10,20,35,.5); display: flex; align-items: center; justify-content: center; }
.modal[hidden], .toast[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 10px; padding: 1.4rem; width: 420px; max-width: 92vw; display: grid; gap: .7rem; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #1c6b38; color: #fff; padding: .6rem 1.2rem; border-radius: 8px; }
@media (max-width: 800px) { .ficha { grid-template-columns: 1fr; } header nav { margin-left: 0; } }
