/* ======================= FONTS ======================= */
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap
}

/* ======================= TOKENS (TU ROOT) ======================= */
:root {
  --main-blue: #0079c8;
  --main-orange: #db3907;
  --main-lila: #d02670;

  --ink: #00335b;
  --bg: #F5F5F5;
  --card: #ffffff;
  --muted: #4d5b66;
  --line: #e9eef2;
  --border: #e9eef2;
  --shadow: 0 10px 22px rgba(0, 0, 0, .08);

  --danger: #b00020;
  /* alineado con tu error */
  --ok: #3ddc97;

  --btn: #ffffff;
  --btn2: #f4f7fb;

  --topbar-bg: rgba(255, 255, 255, .92);
  --topbar-border: var(--line);

  --input-bg: #ffffff;
  --input-border: var(--line);
  --input-text: var(--ink);

  --link: var(--main-blue);

  --radius-xl: 18px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --focus: 0 0 0 4px rgba(0, 121, 200, .16);
}

/* ======================= DARK THEME ======================= */
html.dark {
  --bg: #0f1115;
  --card: #171a21;
  --muted: #9aa4b2;
  --ink: #eaeaea;

  --line: #223043;
  --border: #2a2f3a;

  --btn: #0f172a;
  --btn2: #111c33;

  --topbar-bg: rgba(11, 15, 20, .90);
  --topbar-border: var(--line);

  --input-bg: #0d131c;
  --input-border: var(--line);
  --input-text: var(--ink);

  --link: #a9c8ff;

  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --focus: 0 0 0 4px rgba(169, 200, 255, .18);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  min-height: 100vh;
  font: 14px/1.45 "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(0, 121, 200, .10), transparent 60%),
    radial-gradient(800px 450px at 90% 0%, rgba(208, 38, 112, .10), transparent 55%),
    var(--bg);
  color: var(--ink);
}

/* ======================= TOPBAR ======================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--topbar-border);
  position: sticky;
  top: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  max-width: 1200px;
  margin: 0 auto;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  letter-spacing: .2px
}

.container {
  padding: 18px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ======================= INPUTS ======================= */
input,
select {
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

input:focus,
select:focus {
  border-color: rgba(0, 121, 200, .45);
  box-shadow: var(--focus);
}

/* ======================= CARDS / PANELS ======================= */
.card,
.panel-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.card__title {
  font-weight: 800
}

.card__meta {
  color: var(--muted);
  font-size: 12px
}

.muted {
  color: var(--muted)
}


/* ======================= ERROR ======================= */
.error {
  margin: 12px 16px;
  padding: 10px 12px;
  border: 1px solid rgba(176, 0, 32, .28);
  background: rgba(176, 0, 32, .06);
  color: var(--danger);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  font-weight: 600;
}

/* ======================= TABLE ======================= */
.table-wrap {
  overflow: auto
}

.table {
  width: 100%;
  border-collapse: collapse
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700
}

/* ======================= BADGES ======================= */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: rgba(0, 121, 200, .06);
}

/* Mantengo tus clases, pero alineadas con tu marca */
.badge--student {
  color: var(--danger);
  border-color: rgba(176, 0, 32, .28);
  font-weight: 700;
  background: rgba(176, 0, 32, .06)
}

.badge--pending {
  color: var(--main-orange);
  border-color: rgba(219, 57, 7, .28);
  font-weight: 700;
  background: rgba(219, 57, 7, .06)
}

.badge--agepending {
  color: var(--muted);
  border-color: rgba(165, 145, 29, 0.25);
  font-weight: 700;
  background: rgba(77, 91, 102, .06)
}

.badge--sent {
  color: var(--main-blue);
  border-color: rgba(0, 121, 200, .28);
  font-weight: 700;
  background: rgba(0, 121, 200, .06)
}

.badge--won {
  color: var(--ok);
  border-color: rgba(61, 220, 151, .30);
  font-weight: 700;
  background: rgba(61, 220, 151, .06)
}

.badge--lost {
  color: var(--danger);
  border-color: rgba(176, 0, 32, .28);
  font-weight: 700;
  background: rgba(176, 0, 32, .06)
}

.badge--future {
  color: #6d4aff;
  border-color: rgba(109, 74, 255, .28);
  font-weight: 700;
  background: rgba(109, 74, 255, .06)
}

.badge--all {
  color: var(--muted);
  border-color: rgba(77, 91, 102, .25);
  font-weight: 700;
  background: rgba(77, 91, 102, .06)
}

/* ======================= BUTTONS ======================= */
.btn {
  background: var(--btn);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.btn:hover {
  background: var(--btn2);
  border-color: rgba(0, 121, 200, .35);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none
}

.btn--ghost {
  background: transparent
}

.btn--primary {
  background: linear-gradient(180deg, rgba(0, 121, 200, .12), rgba(0, 121, 200, .06));
  border-color: rgba(0, 121, 200, .40);
}

.btn--primary:hover {
  background: linear-gradient(180deg, rgba(0, 121, 200, .16), rgba(0, 121, 200, .08));
  border-color: rgba(0, 121, 200, .55);
}

.btn-danger {
  background: #dc2626;
  /* rojo */
  border-color: #b91c1c;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
}

.btn-danger:active {
  background: #991b1b;
}

#duplicateBtn.btn {
  margin-top: 10px;
}

#openMediadoresBtn,
#fillMediadoresPricesBtn {
  padding: 8px 12px;
  border: 1px solid #0b74de;
  border-radius: 6px;
  background: #fff;
  color: #0b74de;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
}

#openMediadoresBtn:hover,
#fillMediadoresPricesBtn:hover {
  background: #f0f7ff;
}

#openMediadoresBtn:active,
#fillMediadoresPricesBtn:active {
  transform: translateY(1px);
}

#fillBravoBtn {
  background: #0f766e;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#fillBravoBtn:hover {
  background: #115e59;
}

#fillBravoBtn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.8;
}

.hidden {
  display: none !important;
}

/* ======================= LINKS ======================= */
.link {
  color: var(--link);
  font-weight: 800;
  text-decoration: none
}

.link:hover {
  text-decoration: underline
}

/* ======================= LAYOUT HELPERS ======================= */
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr
  }
}

.kv {
  padding: 8px 16px 16px
}

.kv__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 51, 91, .18);
}

html.dark .kv__row {
  border-bottom-color: rgba(255, 255, 255, .16)
}

.kv__k {
  color: var(--muted)
}

.form {
  padding: 16px;
  display: grid;
  gap: 12px
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700
}

.status {
  min-height: 18px
}

.pill {
  display: inline-block;
  margin-left: .5rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1.2;
  vertical-align: middle;
}

.pill--bad {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dark .pill--bad {
  background: rgba(239, 68, 68, .15);
  color: #fecaca;
  border-color: rgba(239, 68, 68, .35);
}

.dob-warning {
  border: 2px solid #d32f2f;
  background: #fff3f3;
  padding: 2px 4px;
  border-radius: 4px;
}

.manual-fab {
  position: fixed;
  right: 184px;
  bottom: 24px;
  z-index: 9999;
}

.manual-fab__toggle {
  width: 126px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 20px;
  font-family: 'Montserrat';
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  transition: transform .2s ease, background .2s ease;
}

.manual-fab__toggle:hover {
  transform: scale(1.06);
}

.manual-fab__panel {
  position: absolute;
  bottom: 70px;
  /* ← clave: lo coloca encima del botón */
  right: 0;

  width: 320px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);

  opacity: 0;
  transform: translateY(10px) scale(.96);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.manual-fab.is-open .manual-fab__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.manual-fab.is-open .manual-fab__toggle {
  background: #2b2b2b;
}

.manual-fab__title {
  font-weight: 700;
  margin-bottom: 12px;
}

.manual-fab__field {
  display: block;
  margin-bottom: 12px;
}

.manual-fab__field span {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #555;
}

.manual-fab__field input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  outline: none;
}

.manual-fab__field input:focus {
  border-color: #111;
}

.manual-fab__actions {
  display: flex;
  justify-content: flex-end;
}

.manual-fab__apply {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-family: 'Montserrat';
}

.tabs {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}

.tab {
  border: 1px solid var(--border, #ddd);
  background: transparent;
  color: inherit;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tab--active {
  background: #fff;
  color: #111;
}

.app-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.app-status--new {
  background: #eef2ff;
  color: #3730a3;
}

.app-status--docs_pending {
  background: #fff7ed;
  color: #9a3412;
}

.app-status--risks {
  background: #fee2e2;
  color: #991b1b;
}

.app-status--recorded {
  background: #e0f2fe;
  color: #075985;
}

.app-status--payment_pending {
  background: #fef9c3;
  color: #854d0e;
}

.app-status--payment_rejected {
  background: #ffe4e6;
  color: #9f1239;
}

.app-status--accounting_pending {
  background: #f3e8ff;
  color: #6b21a8;
}

.app-status--action_for_registration {
  background: #dcfce7;
  color: #166534;
}

.app-status--active {
  background: #d1fae5;
  color: #065f46;
}

.app-status--rejected {
  background: #fee2e2;
  color: #7f1d1d;
}

.app-status--future {
  background: #e0e7ff;
  color: #3730a3;
}

.app-status--nc {
  background: #f1f5f9;
  color: #475569;
}

.app-status--date_change {
  background: #ccfbf1;
  color: #115e59;
}

.app-status--unknown {
  background: #e5e7eb;
  color: #374151;
}

.application-status-select {
  font-weight: 600;
}

.status-saved {
  margin-left: 8px;
  color: #16a34a;
  font-weight: 700;
  font-size: 18px;
}

textarea.input {
  min-height: 80px;
  resize: vertical;
}