body { font-family: system-ui, sans-serif; margin: 0; background: #f5f5f4; color: #1f1f1f; }
.iba-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: #1f2937; color: #fff; }
.iba-brand { font-weight: 700; letter-spacing: .05em; }
.iba-content { padding: 2rem; display: flex; justify-content: center; }
.iba-card { background: #fff; border-radius: .5rem; padding: 2rem; max-width: 480px; width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,.1); box-sizing: border-box; }
.iba-status { color: #15803d; font-weight: 600; }
.iba-empty { color: #6b7280; font-style: italic; }
.iba-messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.iba-messages li { background: #eef2ff; color: #3730a3; padding: .5rem .75rem; border-radius: .375rem; margin-bottom: .5rem; }

.iba-nav-link { color: #fff; text-decoration: none; margin-right: 1rem; opacity: .9; }
.iba-nav-link:hover { opacity: 1; text-decoration: underline; }

.iba-wide { max-width: 1080px; width: 100%; }
.iba-content:has(.iba-wide) { justify-content: center; }

.iba-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.iba-subtitle { color: #6b7280; margin: .25rem 0 0; }

.iba-button, .iba-button-secondary {
  display: inline-block; border: none; border-radius: .375rem; padding: .6rem 1.1rem;
  font-weight: 600; cursor: pointer; text-decoration: none; font-size: .95rem;
}
.iba-button { background: #1f2937; color: #fff; }
.iba-button:hover { background: #111827; }
.iba-button-secondary { background: #e5e7eb; color: #1f2937; margin-top: .5rem; }
.iba-button-secondary:hover { background: #d1d5db; }
.iba-link { color: #4338ca; text-decoration: none; margin-left: .75rem; }
.iba-link:hover { text-decoration: underline; }

.iba-filters { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.iba-filters input, .iba-filters select { padding: .5rem; border: 1px solid #d1d5db; border-radius: .375rem; }
.iba-filters button { padding: .5rem 1rem; border: 1px solid #d1d5db; border-radius: .375rem; background: #fff; cursor: pointer; }

.iba-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.iba-org-card {
  background: #fff; border-radius: .5rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.1);
  text-decoration: none; color: inherit; display: block; transition: box-shadow .15s;
}
.iba-org-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.iba-org-card h3 { margin: .5rem 0 .25rem; }
.iba-org-meta { margin: 0; color: #6b7280; font-size: .9rem; }
.iba-org-updated { margin-top: .5rem; font-size: .8rem; }

.iba-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e5e7eb; color: #374151; }
.iba-badge-onboarding { background: #dbeafe; color: #1e40af; }
.iba-badge-diagnosis { background: #fef3c7; color: #92400e; }
.iba-badge-intervention { background: #fde68a; color: #78350f; }
.iba-badge-reevaluation { background: #ede9fe; color: #5b21b6; }
.iba-badge-followup { background: #dcfce7; color: #166534; }
.iba-badge-closed { background: #e5e7eb; color: #4b5563; }

.iba-form-card { max-width: 620px; }
.iba-form-card form p { display: flex; flex-direction: column; gap: .25rem; }
.iba-form-card label { font-weight: 600; font-size: .9rem; }
.iba-form-card input, .iba-form-card select, .iba-form-card textarea {
  padding: .5rem; border: 1px solid #d1d5db; border-radius: .375rem; font: inherit;
}

.iba-expediente-header { display: flex; justify-content: space-between; align-items: flex-start; background: #fff; border-radius: .5rem; padding: 1.5rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.iba-expediente-header h1 { margin: .25rem 0; }
.iba-expediente-meta { text-align: right; font-size: .9rem; color: #4b5563; }
.iba-expediente-meta p { margin: .25rem 0; }

.iba-tabs { display: flex; gap: .25rem; border-bottom: 2px solid #e5e7eb; margin-bottom: 1.5rem; flex-wrap: wrap; }
.iba-tabs a, .iba-tab-disabled {
  padding: .75rem 1rem; text-decoration: none; color: #6b7280; font-weight: 600; font-size: .85rem;
  border-bottom: 3px solid transparent; letter-spacing: .03em;
}
.iba-tabs a:hover { color: #1f2937; }
.iba-tabs a.active { color: #1f2937; border-bottom-color: #1f2937; }
.iba-tab-disabled { color: #d1d5db; cursor: not-allowed; }

.iba-tab-panel { display: flex; flex-direction: column; gap: 1rem; }
.iba-resumen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.iba-resumen-grid .iba-card h4 { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; }
.iba-resumen-grid .iba-card { max-width: none; }
.iba-tab-panel .iba-card { max-width: none; width: auto; }

.iba-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.iba-table th, .iba-table td { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid #f0f0f0; font-size: .9rem; }

.iba-add-details { margin-top: 1rem; }
.iba-add-details summary { cursor: pointer; font-weight: 600; color: #4338ca; }
.iba-inline-form { margin-top: .75rem; }
.iba-inline-form p { display: flex; flex-direction: column; gap: .25rem; margin: 0 0 .5rem; }
.iba-inline-form input, .iba-inline-form select, .iba-inline-form textarea { padding: .4rem; border: 1px solid #d1d5db; border-radius: .375rem; }

/* Sprint 3 — Evaluaciones y Participación (ciclos/evaluaciones/asignaciones) */
.iba-badge-draft { background: #e5e7eb; color: #4b5563; }
.iba-badge-open { background: #dbeafe; color: #1e40af; }
.iba-badge-in_progress { background: #fef3c7; color: #92400e; }
.iba-badge-processed { background: #dcfce7; color: #166534; }
.iba-badge-cancelled, .iba-badge-expired { background: #fee2e2; color: #991b1b; }
.iba-badge-archived { background: #e5e7eb; color: #4b5563; }
.iba-badge-valid { background: #dcfce7; color: #166534; }
.iba-badge-provisional { background: #fef3c7; color: #92400e; }
.iba-badge-insufficient_data { background: #fee2e2; color: #991b1b; }
.iba-badge-invalid { background: #fee2e2; color: #991b1b; }
.iba-score-bar-track { background: #e5e7eb; border-radius: 999px; height: .5rem; width: 100%; overflow: hidden; }
.iba-score-bar-fill { background: #1f2937; height: 100%; border-radius: 999px; }
.iba-distribution-bar { display: flex; height: 1.1rem; border-radius: .25rem; overflow: hidden; width: 100%; min-width: 120px; }
.iba-dist-favorable { background: #22c55e; }
.iba-dist-neutral { background: #d1d5db; }
.iba-dist-unfavorable { background: #ef4444; }
.iba-badge-pending { background: #e5e7eb; color: #4b5563; }
.iba-badge-completed { background: #dcfce7; color: #166534; }
.iba-code { font-family: ui-monospace, monospace; font-size: .85rem; color: #4b5563; }
.iba-link-box {
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: .375rem;
  padding: .75rem 1rem; margin: 1rem 0; word-break: break-all; font-family: ui-monospace, monospace;
  font-size: .85rem; color: #065f46;
}
.iba-checkbox-inline { display: flex !important; flex-direction: row !important; align-items: center; gap: .4rem; font-weight: 400 !important; }

/* Portal público de participación — mobile first (IBA-DEV-BACKLOG-001 §77), sin nav/sesión */
.iba-public-body { background: #f5f5f4; min-height: 100vh; margin: 0; font-family: system-ui, sans-serif; color: #1f1f1f; }
.iba-public-wrap { max-width: 520px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.iba-public-brand { text-align: center; font-weight: 700; letter-spacing: .05em; color: #1f2937; margin-bottom: 1.5rem; font-size: .85rem; text-transform: uppercase; }
.iba-public-card { background: #fff; border-radius: .75rem; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.iba-public-card h1 { font-size: 1.3rem; margin-top: 0; }
.iba-public-notice { background: #eef2ff; color: #3730a3; border-radius: .5rem; padding: .85rem 1rem; font-size: .9rem; margin: 1rem 0; }
.iba-public-progress { color: #6b7280; font-size: .85rem; margin-bottom: 1rem; }
.iba-public-question { border-bottom: 1px solid #f0f0f0; padding: 1rem 0; }
.iba-public-question:last-child { border-bottom: none; }
.iba-public-question label.q-text { font-weight: 600; display: block; margin-bottom: .5rem; }
.iba-public-scale { display: flex; gap: .4rem; flex-wrap: wrap; }
.iba-public-scale label {
  flex: 1; min-width: 44px; text-align: center; border: 1px solid #d1d5db; border-radius: .375rem;
  padding: .6rem .3rem; cursor: pointer; font-size: .9rem;
}
.iba-public-scale input { position: absolute; opacity: 0; }
.iba-public-scale input:checked + span { display: block; }
.iba-public-scale label:has(input:checked) { background: #1f2937; color: #fff; border-color: #1f2937; }
.iba-public-yesno { display: flex; gap: .6rem; }
.iba-public-yesno label {
  flex: 1; text-align: center; border: 1px solid #d1d5db; border-radius: .375rem; padding: .6rem; cursor: pointer;
}
.iba-public-yesno label:has(input:checked) { background: #1f2937; color: #fff; border-color: #1f2937; }
.iba-public-choice label, .iba-public-na { display: block; padding: .35rem 0; cursor: pointer; font-size: .9rem; }
.iba-public-text { width: 100%; padding: .6rem; border: 1px solid #d1d5db; border-radius: .375rem; font: inherit; box-sizing: border-box; }
.iba-public-errors { background: #fee2e2; color: #991b1b; border-radius: .5rem; padding: .85rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.iba-public-submit {
  width: 100%; margin-top: 1.5rem; padding: .9rem; border: none; border-radius: .5rem;
  background: #1f2937; color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.iba-public-submit:hover { background: #111827; }
.iba-public-center { text-align: center; }
.iba-login-shell {
  width: 100%;
  max-width: 1100px;
  margin: 3rem auto;
  display: grid;
  grid-template-columns: 42% 58%;
  min-height: 560px;
  background: #fff;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0,0,0,.12);
}

.iba-login-shell .iba-login {
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.iba-login-image {
  min-height: 560px;
  overflow: hidden;
}

.iba-login-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 800px) {
  .iba-login-shell {
    grid-template-columns: 1fr;
    margin: 1rem auto;
  }

  .iba-login-image {
    min-height: 280px;
  }
}
/* IBA LOGIN — ajuste visual 2026-08-31 */
.iba-login-shell {
    grid-template-columns: 42% 58%;
    max-width: 1180px;
    min-height: 560px;
}

.iba-login-shell .iba-login {
    padding: 3.5rem;
}

.iba-login-image {
    min-height: 560px;
}

.iba-login-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}
/* IBA LOGIN — fondo completo */
body:has(.iba-login-shell) {
    margin: 0;
    min-height: 100vh;
    background-image: url('/static/img/iba-4.jpg');
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body:has(.iba-login-shell) main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

body:has(.iba-login-shell) .iba-login-shell {
    display: block;
    width: 440px;
    min-height: auto;
    margin-left: 8vw;
    background: rgba(255,255,255,0.94);
    border-radius: 16px;
    overflow: hidden;
}

body:has(.iba-login-shell) .iba-login {
    padding: 3.5rem;
}

body:has(.iba-login-shell) .iba-login-image {
    display: none;
}

.iba-privacy-link {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(31, 41, 55, .12);
    text-align: center;
    font-size: .85rem;
}

.iba-privacy-link a {
    color: #4b5563;
    text-decoration: none;
}

.iba-privacy-link a:hover,
.iba-privacy-link a:focus {
    color: #1f2937;
    text-decoration: underline;
}
