:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f0;
  color: #17201a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  align-items: center;
  background: #24382b;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-panel {
  background: #fff;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.login-panel h1 {
  font-size: 34px;
  line-height: 1;
  margin: 0;
}

.login-panel label,
.profile-panel label,
.jornada-form label,
.form-grid label {
  display: grid;
  gap: 6px;
}

span,
small,
p {
  color: #617064;
}

input,
select {
  background: #f8faf7;
  border: 1px solid #d9e0d6;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.login-panel button,
.top-actions button,
.source-bar button,
.jornada-form button,
.panel-header button,
.profile-panel button {
  background: #24382b;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-weight: 700;
  min-height: 38px;
  padding: 0 14px;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar,
.source-bar,
.profile-panel,
.jornada-bar,
.layout,
.ticket-panel {
  margin-left: auto;
  margin-right: auto;
  max-width: 1480px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 14px;
  margin: 0 0 4px;
}

h1 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  margin: 0;
}

h2,
h3,
p {
  margin: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.profile-panel,
.source-bar,
.jornada-form,
.selected-jornada,
.panel {
  background: #fff;
  border: 1px solid #d8ded6;
  border-radius: 8px;
}

.profile-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
}

.profile-panel form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr repeat(3, minmax(130px, 180px)) auto;
}

.source-bar {
  align-items: center;
  background: #24382b;
  color: #fff;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 160px auto;
  margin-bottom: 16px;
  padding: 12px;
}

.source-bar span {
  color: #c9d6ce;
}

.source-bar button {
  background: #f2c34a;
  color: #192117;
}

.jornada-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.jornada-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 120px 170px auto;
  padding: 12px;
}

.selected-jornada {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.selected-jornada div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-jornada button {
  background: #eef4ec;
  border: 1px solid #d5e0d2;
  border-radius: 999px;
  color: #26362b;
  min-height: 30px;
  padding: 0 10px;
}

.saved-jornadas {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.saved-jornadas article {
  background: #fff;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
}

.saved-jornadas button {
  border: 0;
  min-height: 50px;
  padding: 8px 10px;
}

.saved-jornadas .load {
  background: #fff;
  display: grid;
  text-align: left;
}

.saved-jornadas .delete {
  background: #fff0ed;
  color: #913224;
}

.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(250px, 0.75fr) minmax(520px, 1.5fr) minmax(280px, 0.85fr);
}

.panel {
  box-shadow: 0 14px 34px rgba(22, 35, 24, 0.08);
  overflow: hidden;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid #e5e9e3;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 16px;
}

.matches {
  display: grid;
  gap: 8px;
  max-height: 680px;
  overflow: auto;
  padding: 12px;
}

.match-row {
  align-items: center;
  background: #f8faf7;
  border: 1px solid #e2e7df;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 6px;
}

.match-row.active {
  background: #e9f3ed;
  border-color: #7aaa84;
}

.match-row .pick-match {
  align-items: center;
  background: transparent;
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 28px 1fr;
  text-align: left;
}

.match-row .pick-match span {
  align-items: center;
  background: #1e2d24;
  border-radius: 6px;
  color: #fff;
  display: flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.match-row strong,
.match-row small {
  display: block;
}

.mini-add,
.mini-danger {
  border: 0;
  border-radius: 6px;
  min-height: 30px;
  padding: 0 9px;
}

.mini-add {
  background: #dceadc;
  color: #1f5b2f;
}

.mini-danger {
  background: #fff0ed;
  color: #913224;
}

.empty {
  color: #617064;
  padding: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px;
}

.toggle {
  align-items: center;
  background: #f8faf7;
  border: 1px solid #d9e0d6;
  border-radius: 7px;
  display: flex !important;
  gap: 8px;
  grid-column: span 3;
  min-height: 42px;
  padding: 0 10px;
}

.toggle input {
  min-height: auto;
  width: auto;
}

.team-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  padding: 0 16px 16px;
}

.team-block {
  border: 1px solid #e1e7de;
  border-radius: 8px;
  padding: 14px;
}

.range-field {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 95px 1fr 34px;
  min-height: 34px;
}

.range-field input {
  accent-color: #327144;
  min-height: auto;
}

.range-field output {
  text-align: right;
}

.analysis-block {
  border-top: 1px solid #e5e9e3;
  padding: 16px;
}

.analysis-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.report-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.report-card {
  background: #f8faf7;
  border: 1px solid #dde5da;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
}

.metrics span {
  background: #eef4ec;
  border-radius: 6px;
  padding: 6px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.prediction-panel {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 20px;
  text-align: center;
}

.prediction-panel strong {
  background: #17251d;
  border-radius: 8px;
  color: #fff;
  font-size: 46px;
  min-width: 96px;
  padding: 10px 16px;
}

.controls {
  padding-bottom: 14px;
}

#weightControls {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.ticket-panel {
  margin-top: 16px;
}

.status-strip {
  color: #617064;
  font-size: 13px;
}

.ticket-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: 16px;
}

.ticket-card {
  background: #f8faf7;
  border: 1px solid #e1e7de;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 12px;
}

.ticket-card.risky {
  background: #fff8ed;
  border-color: #f3d6a9;
}

.ticket-card header,
.ticket-card div,
.ticket-card label {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.ticket-card header span {
  align-items: center;
  background: #1e2d24;
  border-radius: 6px;
  color: #fff;
  display: flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.ticket-card div strong {
  font-size: 30px;
}

@media (max-width: 1120px) {
  .layout,
  .profile-panel form {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .source-bar,
  .jornada-form,
  .team-grid,
  .report-grid,
  .form-grid,
  .side-stack {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toggle {
    grid-column: auto;
  }
}
