/* taitest.es 3.4.2 · identidad original, administración y operaciones de producción */
:root {
  --brand-navy: #071b43;
  --brand-blue: #1267f4;
  --brand-blue-dark: #0846b4;
  --brand-ice: #eef5ff;
}

.topbar-inner { min-height: 78px; height: auto; padding-block: 8px; }
.brand { flex: 0 0 auto; gap: 10px; }
.brand-wordmark { display: block; width: 220px; height: auto; object-fit: contain; }
.brand-icon-compact { display: none; width: 48px; height: 49px; object-fit: contain; }
.main-nav { min-width: 0; }
.main-nav > a { white-space: nowrap; }

.footer-brand-icon { width: 54px; height: 57px; object-fit: contain; border-radius: 14px; }
.footer-brand-name { color: #fff; font-size: 1.28rem; font-weight: 850; letter-spacing: -.055em; }
.footer-brand-name span { color: #70a9ff; }

.installer-brand { display: block; width: min(330px, 90%); margin: 0 auto 28px; }
.installer-brand img, .upgrade-logo { display: block; width: 100%; height: auto; }
.upgrade-logo { max-width: 390px; margin: 0 auto 28px; }

.admin-create-panel { margin-bottom: 18px; border-color: #bcd3fb; background: linear-gradient(145deg,#fff,#f5f9ff); }
.admin-create-panel[hidden] { display: none !important; }
.admin-user-create-form { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; align-items: end; }
.admin-user-create-form .check-setting { min-height: 48px; margin: 0; }
.admin-user-create-form .btn { min-height: 46px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--brand-navy); font-size: 1.3rem; cursor: pointer; }
.user-filter-bar { grid-template-columns: minmax(210px,1.35fr) repeat(3,minmax(150px,1fr)) auto; }
.danger-zone { border-color: #f4c8ce; background: #fffafb; }

.topic-edit-form { display: grid; grid-template-columns: 64px minmax(320px,1fr) 64px auto; gap: 9px; align-items: start; min-width: 620px; }
.topic-title-editor { min-height: 88px; resize: vertical; line-height: 1.45; }
.topic-number,.topic-position { text-align: center; }
.structure-block .data-table td { vertical-align: top; }
.structure-block .data-table th:nth-child(2) { min-width: 520px; }

.import-rules-card { display: grid; grid-template-columns: minmax(230px,.9fr) minmax(320px,1.3fr) auto; gap: 26px; align-items: center; margin-bottom: 28px; border-color: #c7d9f8; background: linear-gradient(135deg,#f7faff,#fff); }
.import-rules-card h3 { margin: 5px 0 8px; }
.import-rules-card ol { margin: 0; padding-left: 20px; color: var(--muted); }
.import-rules-card li + li { margin-top: 5px; }

.library-tree nav a b,.topic-folder-list strong { line-height: 1.35; }
.question-card .question-meta .tag:nth-child(3) { max-width: min(580px,70vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-question-list [hidden] { display: none !important; }

.simulation-readiness { display: grid; gap: 7px; margin-top: 18px; padding: 15px; border: 1px solid #cfdaeb; border-radius: 14px; background: #f7f9fd; color: var(--brand-navy); }
.simulation-readiness span,.simulation-readiness small { color: var(--muted); line-height: 1.45; }
.exam-context { margin-bottom: 22px; padding: 0; overflow: clip; border-color: #bcd3fb; }
.exam-context summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 22px; cursor: pointer; list-style: none; background: linear-gradient(135deg,#f5f9ff,#fff); }
.exam-context summary::-webkit-details-marker { display: none; }
.exam-context summary > span:first-child { display: grid; gap: 3px; }
.exam-context summary small { color: var(--muted); font-weight: 500; }
.exam-context[open] summary { border-bottom: 1px solid var(--line); }
.exam-context-copy { max-height: 42vh; overflow: auto; padding: 22px; line-height: 1.72; color: #243653; white-space: normal; }
.result-context { margin-top: 22px; }
.question-card.is-marked { border-color: #f0b94c; box-shadow: 0 20px 55px rgba(167,105,0,.11); }
.question-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.question-tool { min-height: 38px; padding: 8px 13px; border: 1px solid #cbd7e8; border-radius: 10px; background: #fff; color: #40526d; font: inherit; font-size: .86rem; font-weight: 750; cursor: pointer; }
.question-tool:hover:not(:disabled) { border-color: var(--brand-blue); color: var(--brand-blue-dark); background: var(--brand-ice); }
.question-tool.active { border-color: #dda62d; color: #785000; background: #fff8df; }
.question-tool:disabled { cursor: not-allowed; opacity: .48; }
.question-dot.marked { box-shadow: inset 0 0 0 2px #f1b936; }
.question-dot.marked::after { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #e09a00; }
.question-dot { position: relative; }
.legend span:nth-child(3)::before { background: #f1b936; }
.section-results small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.result-notice { margin: 14px 0 0; padding: 12px 14px; border: 1px solid #bfd5fa; border-radius: 12px; background: #f3f8ff; color: #29486f; font-size: .91rem; line-height: 1.5; }

.page-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.page-header-actions form { margin: 0; }
.system-dashboard { display: grid; gap: 22px; min-width: 0; }
.production-overview { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 28px; padding: 27px; border-color: #bfd3f4; background: linear-gradient(135deg,#f4f8ff 0%,#fff 62%); }
.production-overview h2 { margin: 5px 0 7px; }
.production-overview p { margin: 0; color: var(--muted); }
.production-score { position: relative; display: grid; place-content: center; width: 142px; aspect-ratio: 1; flex: 0 0 auto; border-radius: 50%; text-align: center; background: conic-gradient(var(--brand-blue) calc(var(--score) * 1%),#dce7f8 0); isolation: isolate; }
.production-score::before { content: ''; position: absolute; inset: 11px; z-index: -1; border-radius: inherit; background: #fff; box-shadow: inset 0 0 0 1px #dce5f2; }
.production-score strong { display: block; color: var(--brand-navy); font-size: 1.65rem; line-height: 1; }
.production-score span { display: block; max-width: 82px; margin-top: 6px; color: var(--muted); font-size: .69rem; line-height: 1.2; }
.status-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.setup-callout { display: grid; grid-template-columns: minmax(230px,.8fr) minmax(340px,1.2fr); gap: 28px; align-items: center; border-color: #9ec1fb; background: linear-gradient(135deg,#edf5ff,#fff); }
.setup-callout h2 { margin: 5px 0 7px; }
.setup-callout p { margin: 0; color: var(--muted); }
.runtime-setup-form { display: grid; grid-template-columns: minmax(210px,1fr) minmax(140px,.55fr); gap: 11px; align-items: end; }
.runtime-setup-form .form-group { margin: 0; }
.runtime-setup-form .btn { grid-column: 1 / -1; justify-self: start; }
.production-check-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.production-check-card { min-width: 0; }
.production-check-card .system-check-list > div { align-items: flex-start; gap: 14px; }
.production-check-card .system-check-list small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.production-check-card .system-check-list .tag { flex: 0 0 auto; }
.operations-grid .card { min-width: 0; }
.inline-action-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; }
.inline-action-form .form-group { margin: 0; }
.command-box { display: block; max-width: 100%; margin: 14px 0; padding: 13px 14px; overflow-x: auto; border: 1px solid #cedbed; border-radius: 11px; background: #f5f8fc; color: #17345d; font-size: .78rem; line-height: 1.55; white-space: nowrap; }
.backup-policy { margin: 14px 0 0; }
.settings-page-stack { display: grid; gap: 30px; min-width: 0; }
.integration-settings { padding-top: 28px; border-top: 1px solid var(--line); }
.integration-settings .card-head h2 { margin: 4px 0 0; }
.settings-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; }
.settings-save-row small { max-width: 560px; color: var(--muted); line-height: 1.45; }
.setup-callout.compact { grid-template-columns: minmax(0,1fr) auto; }
.alert { margin: 16px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; line-height: 1.55; }
.alert p { margin: 0; }
.alert.success { border-color: #b7dfcc; background: #effaf4; color: #17643f; }
.alert.danger { border-color: #efc1ca; background: #fff2f4; color: #9a2e42; }
.fixed-setting { display: grid; align-content: center; min-height: 96px; padding: 16px 18px; border: 1px solid #cedbed; border-radius: 12px; background: #f5f8fc; }
.fixed-setting strong { margin: 5px 0 4px; color: var(--brand-navy); font-size: 1.05rem; }
.fixed-setting small { color: var(--muted); line-height: 1.45; }
.self-test-panel { padding: 27px; border-color: #bed3f5; }
.self-test-head { align-items: flex-start; gap: 24px; }
.self-test-head h2 { margin: 5px 0 7px; }
.self-test-head p { max-width: 740px; margin: 0; }
.self-test-head form { flex: 0 0 auto; }
.self-test-empty { display: grid; gap: 4px; margin-top: 20px; padding: 18px; border: 1px dashed #a9bfdf; border-radius: 13px; background: #f5f9ff; color: var(--brand-navy); }
.self-test-empty span { color: var(--muted); font-size: .91rem; }
.self-test-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px; padding: 15px 18px; border-radius: 13px; background: #f5f8fc; }
.self-test-summary > div:first-child { display: grid; gap: 3px; }
.self-test-summary > div:first-child span { color: var(--muted); font-size: .83rem; }
.self-test-summary .status-summary { margin-top: 0; }
.self-test-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.self-test-group { min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.self-test-group summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; color: var(--brand-navy); }
.self-test-group summary span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.self-test-group[open] summary { border-bottom: 1px solid var(--line); background: #f8faff; }
.self-test-group .system-check-list { padding: 4px 15px; }
.self-test-group .system-check-list > div { align-items: flex-start; gap: 12px; }
.self-test-group .system-check-list small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.table-note { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.table-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.table-actions form { margin: 0; }
.recovery-panel { border-color: #bed3f5; background: linear-gradient(145deg,#fff,#f7faff); }
.deployment-panel { border-color: #9fc4ff; background: linear-gradient(140deg,#eef5ff 0%,#fff 56%); }
.recovery-panel h2,.deployment-panel h2,.log-monitor h2 { margin: 5px 0 7px; }
.recovery-panel .card-head p,.deployment-panel .card-head p,.log-monitor .card-head p { margin: 0; }
.deployment-commands { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.deployment-commands > div { min-width: 0; }
.deployment-commands strong { color: var(--brand-navy); font-size: .9rem; }
.deployment-commands .command-box { margin-bottom: 0; }
.health-endpoint { margin: 15px 0 0; overflow-wrap: anywhere; }
.operation-state-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.operation-state-row span { display: grid; gap: 3px; }
.operation-state-row small { color: var(--muted); }
.log-excerpt { max-height: 360px; margin: 18px 0 0; padding: 17px; overflow: auto; border: 1px solid #263d62; border-radius: 13px; background: #071b43; color: #dceaff; font: .78rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.log-actions form { margin: 0; }

@media (max-width: 1180px) {
  .app-shell .brand-wordmark { display: none; }
  .app-shell .brand-icon-compact { display: block; }
  .main-nav > a { padding-inline: 8px; }
  .admin-user-create-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .user-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .public-shell .brand-wordmark { width: 195px; }
  .import-rules-card { grid-template-columns: 1fr; gap: 16px; }
  .topic-edit-form { min-width: 560px; }
  .production-check-groups { grid-template-columns: 1fr; }
  .self-test-groups { grid-template-columns: 1fr; }
  .setup-callout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar-inner { min-height: 68px; }
  .public-shell .brand-wordmark { display: none; }
  .brand-icon-compact { display: block; width: 44px; height: 45px; }
  .admin-user-create-form,.user-filter-bar { grid-template-columns: 1fr; }
  .admin-user-create-form .check-setting { min-height: auto; }
  .topic-edit-form { grid-template-columns: 58px minmax(290px,1fr); min-width: 430px; }
  .topic-edit-form .topic-position { grid-column: 1; }
  .topic-edit-form .btn { grid-column: 2; justify-self: start; }
  .structure-block .data-table th:nth-child(2) { min-width: 430px; }
  .page-header .actions { width: 100%; }
  .page-header .actions .btn { flex: 1; }
  .exam-context summary,.exam-context-copy { padding: 16px; }
  .exam-context-copy { max-height: 48vh; }
  .question-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .page-header-actions { width: 100%; justify-content: stretch; }
  .page-header-actions > *, .page-header-actions .btn { flex: 1; }
  .production-overview { grid-template-columns: 1fr; justify-items: start; gap: 18px; }
  .production-score { width: 124px; }
  .inline-action-form { grid-template-columns: 1fr; }
  .runtime-setup-form { grid-template-columns: 1fr; }
  .runtime-setup-form .btn { width: 100%; }
  .setup-callout.compact { grid-template-columns: 1fr; }
  .self-test-head,.self-test-summary { align-items: stretch; flex-direction: column; }
  .self-test-head form,.self-test-head .btn { width: 100%; }
  .operation-state-row { align-items: flex-start; flex-direction: column; }
  .log-actions,.log-actions > *,.log-actions .btn { width: 100%; }
  .deployment-commands { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .installer-card { padding-inline: 20px; }
  .installer-brand { width: 96%; }
  .footer-brand-icon { width: 48px; height: 50px; }
  .question-tools { grid-template-columns: 1fr; }
}
