:root { color-scheme: light dark; }
body { font-family: system-ui, sans-serif; margin: 0; padding: 0; background: #f5f6f8; color: #1a1a1a; }
header { display: flex; justify-content: space-between; align-items: center; background: #1c2b3a; color: white; padding: 1rem 1.5rem; }
header h1 { margin: 0; font-size: 1.2rem; }
header p { margin: 0.25rem 0 0; font-size: 0.85rem; color: #b8c4cf; }
nav { display: flex; gap: 0.5rem; padding: 0.75rem 1.5rem; background: white; border-bottom: 1px solid #ddd; }
nav button { padding: 0.5rem 1rem; border: 1px solid #ccc; background: #f0f0f0; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
nav button.active { background: #1c2b3a; color: white; border-color: #1c2b3a; }
main { padding: 1.5rem; }
.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar label { font-size: 0.85rem; display: flex; align-items: center; gap: 0.35rem; }
table { border-collapse: collapse; width: 100%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; font-size: 0.85rem; }
th { background: #eef1f4; position: sticky; top: 0; }
tr:hover { background: #f9fafb; }
img.foto { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 1px solid #ddd; vertical-align: middle; }
/* Foto de expediente mostrada en un evento que no tiene captura propia:
   borde punteado para que nunca se confunda con evidencia del paso real
   (ver eventPhotoCell en app.js). */
img.foto-ref { border: 2px dashed #b9a24a; opacity: 0.85; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.75rem; }
.badge-yes { background: #d4edda; color: #155724; }
.badge-no { background: #f0f0f0; color: #777; }
.status { font-size: 0.8rem; color: #666; margin-bottom: 0.75rem; }
.error { color: #a94442; background: #f2dede; padding: 0.75rem; border-radius: 6px; }
code { background: #eef1f4; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
.method { display: inline-block; min-width: 3.2rem; text-align: center; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; color: white; }
.method-GET { background: #2f80ed; }
.method-POST { background: #27ae60; }
.method-PUT { background: #e2a03f; }
.method-DELETE { background: #c0392b; }
.tester { background: white; padding: 1rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-top: 1.5rem; }
.tester h3 { margin-top: 0; }
.tester-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.tester-row select, .tester-row input[type=text] { padding: 0.4rem; font-size: 0.9rem; border: 1px solid #ccc; border-radius: 6px; }
.tester-row select { width: 7rem; }
.tester-row input[type=text] { flex: 1; }
.tester textarea { width: 100%; min-height: 6rem; font-family: ui-monospace, monospace; font-size: 0.85rem; padding: 0.5rem; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; }
.tester button { padding: 0.5rem 1.25rem; border: none; background: #1c2b3a; color: white; border-radius: 6px; cursor: pointer; font-size: 0.9rem; margin-top: 0.5rem; }
.tester pre { background: #1c2b3a; color: #d9f0e1; padding: 0.75rem; border-radius: 6px; overflow-x: auto; font-size: 0.8rem; margin-top: 0.75rem; white-space: pre-wrap; word-break: break-word; }
.hint { font-size: 0.8rem; color: #666; margin: 0.25rem 0 0.75rem; }
.hidden { display: none !important; }

.login-wrap { max-width: 22rem; margin: 4rem auto; background: white; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.login-wrap h2 { margin-top: 0; }
.login-wrap input { width: 100%; box-sizing: border-box; padding: 0.6rem; margin-bottom: 0.75rem; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; }
.login-wrap button { width: 100%; padding: 0.6rem; border: none; background: #1c2b3a; color: white; border-radius: 6px; cursor: pointer; font-size: 0.95rem; }
.login-error { color: #a94442; background: #f2dede; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.85rem; margin-bottom: 0.75rem; }
.user-bar { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; white-space: nowrap; }
.user-bar button { padding: 0.3rem 0.75rem; border: 1px solid #4a5c6e; background: transparent; color: white; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }

.config-section { background: white; padding: 1rem 1.25rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 1.5rem; }
.config-section h3 { margin-top: 0; }
.config-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; align-items: center; }
.config-form input, .config-form select { padding: 0.4rem; font-size: 0.9rem; border: 1px solid #ccc; border-radius: 6px; }
.config-form button { padding: 0.45rem 1rem; border: none; background: #1c2b3a; color: white; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.secret-box { background: #fff8e1; border: 1px solid #e6c200; border-radius: 6px; padding: 0.75rem; margin-top: 0.75rem; }
.secret-box pre { white-space: pre-wrap; word-break: break-all; background: #1c2b3a; color: #d9f0e1; padding: 0.5rem; border-radius: 4px; margin: 0.5rem 0 0; font-size: 0.85rem; }
.user-card { border-bottom: 1px solid #eee; padding: 0.6rem 0; }
.user-card:last-child { border-bottom: none; }
.user-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; }
.user-card-head button { padding: 0.25rem 0.6rem; border: 1px solid #ccc; background: #f0f0f0; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.user-tokens { margin-top: 0.5rem; padding-left: 0.5rem; border-left: 2px solid #eee; }

.vdetail { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: 1rem; background: #f9fafb; }
.vdetail-photos { display: flex; gap: 1rem; flex-wrap: wrap; }
.vdetail-photos > div { text-align: center; }
img.foto-grande { max-width: 220px; max-height: 220px; object-fit: contain; border-radius: 6px; border: 1px solid #ddd; background: white; }
.vdetail-fields { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; min-width: 16rem; }
.vdetail-fields li { margin-bottom: 0.4rem; }
