.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi, .panel, .project-card, .list-card, .detail-head { padding: 18px 20px; }
.kpi-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.kpi-value, .percent { margin: 6px 0; color: var(--navy); font-size: 34px; font-weight: 800; line-height: 1.1; }
.kpi-value-text { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.kpi-hint { margin: 0; color: var(--muted); font-size: 12px; }

.progress, .bar-track, .mini-bar {
  height: 9px;
  background: #e7eef5;
  border-radius: 999px;
  overflow: hidden;
}

.progress span, .bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: inherit;
}

.bar-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 58px; gap: 12px; align-items: center; margin: 12px 0; }
.bar-name { font-weight: 650; font-size: 13px; }
.bar-row b { text-align: right; }

.note, .empty {
  background: #f4f8fc;
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  padding: 12px 14px;
  color: #345066;
}

.empty h3 { margin: 0 0 4px; color: var(--navy); }

.legend, .chip-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.legend { margin-top: 12px; color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--cyan); }
.dot-green, .signal-green .dot { background: var(--green); }
.dot-orange, .signal-yellow .dot { background: var(--orange); }
.dot-blue, .signal-red .dot { background: var(--blue); }
.dot-gray, .signal-gray .dot { background: #8aa0b5; }
.signal-red .dot { background: var(--red); }

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
}

.chip-blue { background: #e2f2ff; color: #075a9b; }
.chip-amber { background: #fff0db; color: #995200; }
.chip-green { background: #e0f7ec; color: #08734f; }
.chip-gray { background: #edf1f5; color: #4a6174; }
.chip-cyan { background: #e5f8fb; color: #0d6f86; }
.chip-red { background: #fde8e8; color: #9b2c2c; }

.signal { display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; }

.filters, .toolbar, .meta-grid, .mini-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filters, .toolbar { margin: 12px 0 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; font-size: 13px; font-weight: 700; color: var(--navy); }
.field input, .field select, .btn {
  border: 1px solid #cbdbe8;
  background: white;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 650;
}

.btn { cursor: pointer; color: var(--navy); text-decoration: none; display: inline-flex; }
.btn.is-active, .tab.is-active { background: var(--blue); color: white; border-color: var(--blue); }
.btn-print { background: var(--navy); color: white; border-color: var(--navy); }
.btn-small { padding: 6px 10px; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #092641, #0d3a5c 55%, var(--blue));
}
.login-split { display: flex; min-height: 100vh; background: #06172e; }
.login-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: white;
  background: linear-gradient(135deg, rgb(4 18 38 / 86%), rgb(6 34 70 / 55%)), url("../icons/qdm-fondo.jpg") center / cover no-repeat;
}
.login-brand-card {
  max-width: 520px;
  padding: 36px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 26px;
  background: rgb(1 12 28 / 42%);
  box-shadow: 0 30px 80px rgb(0 0 0 / 32%);
  backdrop-filter: blur(10px);
}
.login-brand-card img { display: block; height: 74px; margin-bottom: 26px; object-fit: contain; }
.login-brand-card h1 { margin: 0 0 14px; font-size: 36px; line-height: 1.05; letter-spacing: -.03em; }
.login-brand-card p { margin: 0; color: rgb(255 255 255 / 82%); font-size: 17px; line-height: 1.6; }
.login-panel {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}
.login-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 26px 70px rgb(2 19 45 / 18%);
  border: 1px solid rgb(21 82 145 / 8%);
}
.login-logo-mobile { display: none; height: 54px; margin-bottom: 18px; object-fit: contain; align-self: flex-start; }
.login-eyebrow {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0b62a3;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-card h2 { margin: 0 0 8px; color: #071d36; font-size: 26px; }
.login-help { margin: 0 0 8px; color: #5b6b7d; font-size: 14px; line-height: 1.5; }
.login-card label { margin: 14px 0 0; color: #24364a; font-size: 13px; font-weight: 700; }
.login-card input {
  margin-top: 7px;
  padding: 13px 14px;
  border: 1px solid #d5e1ed;
  border-radius: 13px;
  background: #f8fbff;
  color: #071d36;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.login-card input:focus { border-color: #1f8bd3; background: white; box-shadow: 0 0 0 4px rgb(31 139 211 / 12%); }
.login-submit {
  justify-content: center;
  margin-top: 20px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b75bd, #15a7e2);
  color: white;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 14px 28px rgb(11 117 189 / 25%);
}
.login-submit:hover { filter: brightness(1.04); }
.login-submit:disabled { opacity: .7; cursor: wait; }
.login-message { min-height: 20px; margin: 12px 0 0; color: #c42034; font-size: 13px; font-weight: 700; }
.login-message.is-ok { color: var(--green); }
.login-wait { color: white; font-weight: 700; }
.login-link { align-self: center; border: 0; background: transparent; color: #0b62a3; font-weight: 700; padding: 6px; cursor: pointer; }
.login-footer { display: block; margin-top: 10px; color: #8b98a7; text-align: center; }

.session-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.session-client { display: flex; flex-direction: column; gap: 2px; }
.session-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.session-select {
  min-width: 170px;
  max-width: 240px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
}
.session-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
}
.session-avatar:hover, .session-avatar[aria-expanded="true"] { background: var(--blue); }
.session-avatar:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.session-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 30px rgb(9 38 65 / 18%);
}
.session-menu[hidden] { display: none; }
.session-user { color: var(--navy); font-size: 14px; overflow-wrap: anywhere; }
.session-role { color: var(--muted); font-size: 12px; }
.session-logout { justify-content: center; margin-top: 10px; background: var(--navy); color: white; border-color: var(--navy); font-weight: 700; }
.session-logout:hover { background: var(--blue); border-color: var(--blue); }
.session-password { justify-content: center; margin-top: 10px; color: var(--navy); font-weight: 700; }

.password-dialog { width: min(420px, calc(100vw - 24px)); padding: 0; border: 0; background: transparent; }
.password-dialog::backdrop { background: rgb(7 29 54 / 55%); }
.password-card { max-width: none; }
.password-rules { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: #5b6b7d; }
.password-rules li::before { content: "○ "; }
.password-rules li.is-ok { color: var(--green); }
.password-rules li.is-ok::before { content: "✓ "; }
.password-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.password-actions .login-submit { margin-top: 0; }
.password-cancel { justify-content: center; padding: 13px 16px; border-radius: 14px; font-weight: 700; color: var(--navy); }

.check { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); padding-bottom: 8px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.sort-btn { border: 0; background: transparent; padding: 0; font-weight: 800; color: var(--navy); cursor: pointer; }
.name-stack { display: flex; flex-direction: column; }
.name-stack span, .code { font-family: var(--mono); letter-spacing: 0; text-transform: none; }

.project-top, .detail-head, .alert-top { display: flex; justify-content: space-between; gap: 16px; }
.project-grid > .project-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.project-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.project-details summary { cursor: pointer; font-weight: 800; color: var(--blue); }
.project-details .table-wrap { margin-top: 10px; border-radius: 10px; }
.phase-table td, .phase-table th { padding: 8px 10px; font-size: 13px; }
.phase-table .visual-cell { min-width: 120px; }
.phase-table .progress { max-width: 140px; margin: 4px 0 0; }
.phase-table .total-row td, .phase-table .total-row th { font-weight: 800; color: var(--navy); }
.detail-list { margin: 10px 0 0; padding-left: 18px; }
.detail-list li { margin: 6px 0; }
.overview { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.reading p { margin: 0 0 10px; }
.status-chips { margin: 12px 0; }
.dependency-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.dep { padding: 18px; }
.dep h3 { margin: 8px 0; color: var(--navy); font-size: 16px; }
.hero-next { margin-top: 12px !important; font-weight: 700; color: #ffffff !important; }
.project-card h3, .list-card h3, .alert-card h3 { margin: 4px 0; color: var(--navy); }
.project-card .btn { margin-top: 12px; }
.mini-facts { margin: 12px 0; }
.mini-facts div { min-width: 140px; }
.mini-facts dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.mini-facts dd { margin: 2px 0 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tab { text-decoration: none; border: 1px solid var(--line); background: white; color: var(--navy); border-radius: 999px; padding: 8px 12px; font-weight: 800; white-space: nowrap; }

.detail-head { display: grid; grid-template-columns: 1.4fr .6fr; gap: 12px 20px; margin-bottom: 8px; }
.detail-side { text-align: right; }
.meta-grid { grid-column: 1 / -1; }
.meta-item { min-width: 160px; }
.meta-item span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.meta-item strong { color: var(--navy); }

.track, .mini-kpi { background: #f7fbfe; border-radius: 12px; padding: 12px; }
.track span, .mini-kpi span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.track strong, .mini-kpi strong { display: block; color: var(--navy); font-size: 22px; margin: 4px 0; }
.track p { margin: 0; color: var(--muted); font-size: 12px; }

.stack { display: grid; gap: 12px; }
.list-card h4 { margin: 0 0 6px; }
.details-block { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.details-block summary { cursor: pointer; font-weight: 800; color: var(--blue); }

.gantt { display: grid; gap: 12px; margin: 0 0 16px; }
.schedule-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.schedule-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.schedule-summary strong { color: var(--blue); font-size: 17px; }
.gantt-chart { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.gantt-head, .gantt-row, .gantt-axis { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(0, 1.6fr); }
.gantt-head { background: linear-gradient(135deg, #061b34, #0a3d68); color: white; }
.gantt-head-label, .gantt-head-track { padding: 11px 16px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.gantt-head-track { border-left: 1px solid rgb(255 255 255 / 14%); }
.gantt-row { border-top: 1px solid #e8f0f8; min-height: 52px; }
.gantt-row-label { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #fbfdff; min-width: 0; }
.gantt-row-index { min-width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; background: #eef7ff; color: #045a8a; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.gantt-row-label strong { display: block; color: #092644; font-size: 14px; line-height: 1.25; }
.gantt-row-label strong a { color: inherit; text-decoration: none; }
.gantt-row-label strong a:hover { color: var(--blue); text-decoration: underline; }
.gantt-row-label span:not(.gantt-row-index) { display: block; color: #60748a; font-size: 12px; line-height: 1.3; margin-top: 2px; }
.gantt-row-project .gantt-row-label { background: #eef6fd; }
.gantt-row-project .gantt-row-label strong { font-size: 15px; }
.gantt-group { padding: 7px 14px; border-top: 1px solid #d5e6f4; background: #f3f8fc; color: #045a8a; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.gantt-row-track, .gantt-axis-track { padding: 8px 18px 8px 14px; border-left: 1px solid #e8f0f8; overflow: hidden; }
.gantt-track-canvas { position: relative; width: 100%; min-height: 36px; }
.gantt-week-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #e7f0f8; }
.gantt-week-line.is-month { background: #cfe0ee; }
.gantt-cutoff { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 2px dashed #f28b28; z-index: 2; }
.gantt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 16px; min-width: 6px; border-radius: 999px; overflow: hidden; z-index: 1; }
.gantt-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.gantt-bar-blue, .gantt-key.gantt-bar-blue { background: #cfe6f8; }
.gantt-bar-blue .gantt-bar-fill { background: linear-gradient(90deg, #075a9b, #1aa6d8); }
.gantt-bar-green, .gantt-key.gantt-bar-green { background: #c9eedd; }
.gantt-bar-green .gantt-bar-fill { background: linear-gradient(90deg, #0f7d5c, #24b583); }
.gantt-bar-red, .gantt-key.gantt-bar-red { background: #f7d4d4; }
.gantt-bar-red .gantt-bar-fill { background: linear-gradient(90deg, #a52727, #e05353); }
.gantt-bar-amber, .gantt-key.gantt-bar-amber { background: #fbe3c4; }
.gantt-bar-amber .gantt-bar-fill { background: linear-gradient(90deg, #b8650a, #f2a33a); }
.gantt-bar-gray, .gantt-key.gantt-bar-gray { background: #e3e9ef; }
.gantt-bar-gray .gantt-bar-fill { background: linear-gradient(90deg, #6b7f92, #94a6b6); }
.gantt-diamond { position: absolute; top: 50%; width: 13px; height: 13px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 2px white; z-index: 3; }
.gantt-diamond-green { background: var(--green); }
.gantt-diamond-blue { background: var(--blue); }
.gantt-diamond-red { background: var(--red); }
.gantt-diamond-amber { background: var(--orange); }
.gantt-diamond-gray { background: #8a9bab; }
.gantt-empty { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: #7a8b9b; font-size: 12px; z-index: 1; background: rgb(255 255 255 / 85%); padding: 0 4px; }
.gantt-mark-label { position: absolute; top: 50%; transform: translate(12px, -50%); color: #0f6b4f; font-size: 12px; font-style: normal; font-weight: 700; white-space: nowrap; z-index: 3; }
.gantt-mark-label.is-left { transform: translate(calc(-100% - 12px), -50%); }
.gantt-axis { border-top: 1px solid #d5e6f4; background: #f7fbff; }
.gantt-axis-label { display: flex; align-items: center; padding: 10px 14px; color: #045a8a; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.gantt-axis-canvas { min-height: 40px; }
.gantt-axis-line { position: absolute; left: 0; right: 0; top: 8px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, #075a9b, #1aa6d8); }
.gantt-axis-tick { position: absolute; top: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.gantt-axis-tick i { display: block; width: 9px; height: 9px; margin-left: -4px; background: var(--blue); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 2px white; }
.gantt-axis-tick em { font-style: normal; font-size: 11px; font-weight: 800; color: #51677f; white-space: nowrap; transform: translateX(-50%); }
.gantt-axis-tick:nth-child(2) em { transform: none; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.gantt-key { display: inline-block; width: 22px; height: 10px; border-radius: 999px; }
.gantt-key-fill { display: inline-block; width: 22px; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #075a9b 60%, #cfe6f8 60%); }
.gantt-key-diamond { display: inline-block; width: 10px; height: 10px; background: var(--navy); transform: rotate(45deg); border-radius: 2px; }
.gantt-key-cutoff { display: inline-block; width: 0; height: 14px; border-left: 2px dashed #f28b28; }

.followup { margin-bottom: 20px; }
.followup td { vertical-align: middle; }
.followup-name { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 800; text-decoration: none; }
.followup-name:hover { color: var(--blue); text-decoration: underline; }
.followup-progress { min-width: 130px; }
.followup-progress strong { color: var(--navy); font-size: 18px; }
.followup-date { display: block; margin-bottom: 6px; color: var(--navy); }
.followup-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.followup-facts div { display: contents; }
.followup-facts dt { color: var(--muted); }
.followup-facts dd { margin: 0; color: var(--navy); font-weight: 700; }

.print-intro { align-items: center; justify-content: space-between; padding: 16px 20px; border: 1px solid #cfe2f1; border-left: 4px solid var(--blue); border-radius: 14px; background: #f3f9fe; }
.print-intro strong { color: var(--navy); font-size: 16px; }
.print-intro p { margin: 4px 0 0; }
.timeline-title { margin: 18px 0 10px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { border-left: 3px solid var(--cyan); padding: 4px 0 8px 14px; }

.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list { margin: 8px 0 0; padding-left: 18px; }
.plain-list li { margin: 6px 0; }

.reading p { margin: 0 0 10px; }
.result-count { color: var(--muted); font-weight: 700; }

.report-cover {
  background: linear-gradient(115deg, #092641, #075a9b);
  color: white;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 16px;
}
.report-cover h2 { margin: 8px 0; font-size: 32px; }
.report-cover .eyebrow { color: #90e6ff; }
.report-block { margin: 18px 0; }
.report-block h2 { color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.print-footer { margin-top: 24px; color: var(--muted); font-size: 12px; text-align: center; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
