/* =========================================================
   OBRAX — ESTILO GLOBAL
   ========================================================= */

:root {
  --obrax-blue: #173f67;
  --obrax-blue-dark: #102f4d;
  --obrax-blue-light: #eaf2f9;

  --obrax-orange: #f28c28;
  --obrax-orange-dark: #d87312;

  --obrax-bg: #f4f7fa;
  --obrax-white: #ffffff;

  --obrax-text: #172b3a;
  --obrax-text-soft: #667789;
  --obrax-muted: #8b9aaa;

  --obrax-border: #dce4eb;

  --obrax-success: #16845b;
  --obrax-danger: #c63c3c;

  --radius: 10px;
  --radius-sm: 7px;

  --shadow: 0 4px 18px rgba(20, 45, 70, 0.07);
  --shadow-hover: 0 8px 28px rgba(20, 45, 70, 0.11);

  --font-body: 'Inter', sans-serif;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}


/* =========================================================
   RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;

  font-family: var(--font-body);
  color: var(--obrax-text);

  background: var(--obrax-bg);

  background-image: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

body.has-sidebar {
  padding-left: 250px;
}


/* CONTENEDOR INYECTADO */

#sidebar {
  display: block;
}


/* SIDEBAR */

.obrax-sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: 250px;

  display: flex;
  flex-direction: column;

  background: var(--obrax-blue);

  color: #ffffff;

  z-index: 1000;

  box-shadow: 4px 0 18px rgba(10, 30, 50, 0.10);
}


/* =========================================================
   MARCA
   ========================================================= */

.sidebar-brand {
  padding: 28px 24px 25px;

  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.sidebar-logo {
  font-family: var(--font-display);

  font-size: 30px;
  font-weight: 700;

  letter-spacing: 1px;

  line-height: 1;
}

.sidebar-logo span {
  color: var(--obrax-orange);
}

.sidebar-subtitle {
  margin-top: 7px;

  font-family: var(--font-mono);

  font-size: 10px;
  font-weight: 500;

  letter-spacing: 1.5px;

  color: rgba(255,255,255,0.60);
}


/* =========================================================
   NAVEGACIÓN
   ========================================================= */

.sidebar-nav {
  flex: 1;

  padding: 24px 14px;

  overflow-y: auto;
}

.sidebar-section {
  padding: 0 12px;

  margin: 18px 0 8px;

  font-family: var(--font-mono);

  font-size: 9px;
  font-weight: 500;

  letter-spacing: 1.4px;

  color: rgba(255,255,255,0.42);
}

.sidebar-section:first-child {
  margin-top: 0;
}


/* ITEM */

.sidebar-item {
  position: relative;

  display: flex;
  align-items: center;

  min-height: 43px;

  padding: 0 12px;

  margin-bottom: 4px;

  gap: 11px;

  border-radius: 8px;

  color: rgba(255,255,255,0.72);

  text-decoration: none;

  font-size: 14px;
  font-weight: 500;

  transition:
    background 0.18s ease,
    color 0.18s ease;
}


/* ICONO */

.sidebar-icon {
  width: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;

  color: rgba(255,255,255,0.55);
}


/* HOVER */

.sidebar-item:hover {
  background: rgba(255,255,255,0.08);

  color: #ffffff;
}

.sidebar-item:hover .sidebar-icon {
  color: #ffffff;
}


/* ACTIVO */

.sidebar-item.active {
  background: rgba(255,255,255,0.14);

  color: #ffffff;

  font-weight: 600;
}

.sidebar-item.active::before {
  content: "";

  position: absolute;

  left: 0;
  top: 8px;
  bottom: 8px;

  width: 3px;

  border-radius: 0 3px 3px 0;

  background: var(--obrax-orange);
}

.sidebar-item.active .sidebar-icon {
  color: var(--obrax-orange);
}


/* DESHABILITADO */

.sidebar-item.disabled {
  opacity: 0.48;

  cursor: default;
}

.sidebar-item.disabled:hover {
  background: transparent;
}

.sidebar-item small {
  margin-left: auto;

  font-size: 8px;

  color: rgba(255,255,255,0.35);
}


/* =========================================================
   PARTE INFERIOR SIDEBAR
   ========================================================= */

.sidebar-bottom {
  padding: 16px 14px 18px;

  border-top: 1px solid rgba(255,255,255,0.10);
}


/* USUARIO */

.sidebar-user {
  display: flex;
  align-items: center;

  gap: 10px;

  padding: 9px 8px 14px;
}

.sidebar-avatar {
  flex: 0 0 38px;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: rgba(255,255,255,0.14);

  color: #ffffff;

  font-family: var(--font-display);

  font-size: 17px;
  font-weight: 700;
}

.sidebar-user-info {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 3px;
}

.sidebar-user-info strong {
  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;

  font-size: 12px;
  font-weight: 600;

  color: #ffffff;
}

.sidebar-user-info span {
  font-size: 10px;

  color: rgba(255,255,255,0.50);
}


/* LOGOUT */

.sidebar-logout {
  width: 100%;

  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  border: 1px solid rgba(255,255,255,0.15);

  border-radius: 7px;

  background: transparent;

  color: rgba(255,255,255,0.65);

  font-size: 12px;

  cursor: pointer;

  transition: all 0.18s ease;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,0.08);

  color: #ffffff;

  border-color: rgba(255,255,255,0.25);
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
  height: 62px;

  display: flex;
  align-items: center;

  padding: 0 28px;

  background: #ffffff;

  border-bottom: 1px solid var(--obrax-border);

  position: relative;
}

.topbar::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: -2px;

  height: 2px;

  background: var(--obrax-orange);
}

.topbar .brand {
  display: none;
}

.topbar .empresa {
  flex: 1;

  font-family: var(--font-mono);

  font-size: 11px;

  color: var(--obrax-muted);

  text-align: center;
}

.topbar-actions {
  display: flex;

  align-items: center;

  gap: 8px;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 34px;

  padding: 0 12px;

  border: 1px solid var(--obrax-border);

  border-radius: 7px;

  background: #ffffff;

  color: var(--obrax-text);

  font-size: 12px;

  text-decoration: none;

  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--obrax-blue-light);

  border-color: #cbd9e5;

  color: var(--obrax-blue);
}


/* =========================================================
   CONTENIDO PERFIL
   ========================================================= */

.perfil-container {
  width: min(100% - 56px, 1100px);

  margin: 0 auto;

  padding: 34px 0 60px;
}


/* VOLVER */

.back-link {
  display: inline-block;

  margin-bottom: 18px;

  color: var(--obrax-blue);

  font-size: 13px;
  font-weight: 500;

  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;

  font-family: var(--font-display);

  font-size: 38px;
  font-weight: 700;

  line-height: 1;

  letter-spacing: 0.3px;

  color: var(--obrax-text);
}

.subtitle {
  margin-top: 8px;

  color: var(--obrax-text-soft);

  font-size: 13px;
  line-height: 1.5;
}


/* =========================================================
   HERO PERFIL
   ========================================================= */

.perfil-hero {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 30px;

  padding: 28px 30px;

  margin-bottom: 22px;

  background:
    linear-gradient(
      135deg,
      #173f67 0%,
      #1d527f 100%
    );

  border-radius: 12px;

  box-shadow: var(--shadow);

  color: #ffffff;
}


/* IDENTIDAD */

.perfil-identidad {
  display: flex;
  align-items: center;

  gap: 18px;
}

.avatar {
  width: 74px;
  height: 74px;

  flex: 0 0 74px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: rgba(255,255,255,0.13);

  border: 2px solid rgba(255,255,255,0.25);

  color: #ffffff;

  font-family: var(--font-display);

  font-size: 29px;
  font-weight: 700;
}

.perfil-datos h2 {
  margin: 0 0 5px;

  font-family: var(--font-display);

  font-size: 27px;
  font-weight: 700;

  line-height: 1.05;

  color: #ffffff;
}

.perfil-rol {
  font-size: 12px;

  color: rgba(255,255,255,0.78);
}

.perfil-empresa {
  margin-top: 3px;

  font-family: var(--font-mono);

  font-size: 10px;

  color: rgba(255,255,255,0.52);
}


/* FRASE */

.perfil-frase {
  padding-left: 30px;

  border-left: 1px solid rgba(255,255,255,0.18);

  color: rgba(255,255,255,0.78);

  font-family: var(--font-display);

  font-size: 18px;

  line-height: 1.2;

  text-align: right;
}

.perfil-frase strong {
  display: block;

  margin-top: 7px;

  color: var(--obrax-orange);

  font-family: var(--font-mono);

  font-size: 10px;

  letter-spacing: 1px;
}


/* =========================================================
   GRID
   ========================================================= */

.perfil-grid {
  display: grid;

  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);

  gap: 20px;

  margin-bottom: 20px;
}


/* =========================================================
   CARDS
   ========================================================= */

.perfil-card {
  background: #ffffff;

  border: 1px solid var(--obrax-border);

  border-radius: var(--radius);

  padding: 25px;

  box-shadow: var(--shadow);
}

.perfil-card-header {
  display: flex;

  align-items: flex-start;

  gap: 12px;

  margin-bottom: 22px;
}

.card-icon {
  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: var(--obrax-blue-light);

  color: var(--obrax-blue);

  font-size: 17px;
}

.perfil-card-header h2 {
  margin: 0;

  font-family: var(--font-display);

  font-size: 22px;
  font-weight: 700;

  line-height: 1.05;

  color: var(--obrax-text);
}

.card-description {
  margin-top: 5px;

  color: var(--obrax-text-soft);

  font-size: 12px;
}


/* =========================================================
   FORMULARIOS
   ========================================================= */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;

  margin-bottom: 6px;

  font-size: 11px;
  font-weight: 600;

  color: var(--obrax-text-soft);

  text-transform: uppercase;

  letter-spacing: 0.4px;
}

.form-group label span {
  text-transform: none;

  font-weight: 400;

  color: var(--obrax-muted);
}

input,
select,
textarea {
  width: 100%;

  min-height: 42px;

  padding: 10px 12px;

  border: 1px solid #ccd7e0;

  border-radius: 7px;

  background: #ffffff;

  color: var(--obrax-text);

  font-size: 13px;

  outline: none;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4c80aa;

  box-shadow: 0 0 0 3px rgba(36, 92, 140, 0.10);
}


/* =========================================================
   EMAIL PASSWORD
   ========================================================= */

.email-password {
  display: none;

  margin: -3px 0 16px;

  padding: 14px;

  border: 1px solid #e4d5bc;

  border-radius: 8px;

  background: #fffaf2;
}

.email-password.show {
  display: block;
}

.email-password .hint {
  margin-bottom: 12px;

  font-size: 11px;

  line-height: 1.45;

  color: #876c45;
}


/* =========================================================
   BOTONES PERFIL
   ========================================================= */

.perfil-btn {
  min-height: 40px;

  padding: 0 17px;

  border: 0;

  border-radius: 7px;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  transition: all 0.18s ease;
}

.perfil-btn-primary {
  background: var(--obrax-orange);

  color: #ffffff;
}

.perfil-btn-primary:hover {
  background: var(--obrax-orange-dark);

  transform: translateY(-1px);
}

.perfil-btn-blue {
  background: var(--obrax-blue);

  color: #ffffff;
}

.perfil-btn-blue:hover {
  background: var(--obrax-blue-dark);

  transform: translateY(-1px);
}


/* =========================================================
   CUENTA
   ========================================================= */

.cuenta-card {
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f9fbfd 100%
    );
}

.cuenta-intro {
  margin-bottom: 20px;

  color: var(--obrax-text-soft);

  font-size: 12px;

  line-height: 1.55;
}

.cuenta-lista {
  display: flex;

  flex-direction: column;

  gap: 10px;
}

.cuenta-item {
  display: flex;
  align-items: center;

  gap: 9px;

  color: var(--obrax-text);

  font-size: 12px;
}

.check {
  width: 22px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #e7f6ef;

  color: var(--obrax-success);

  font-size: 11px;
  font-weight: 700;
}


/* =========================================================
   SEGURIDAD
   ========================================================= */

.seguridad-card {
  margin-bottom: 20px;
}

.seguridad-grid {
  display: grid;

  grid-template-columns: minmax(0, 1fr) 280px;

  gap: 28px;

  align-items: start;
}

.password-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 0 16px;
}

.password-grid .full {
  grid-column: 1 / -1;
}


/* RECOMENDACIONES */

.recomendaciones {
  padding: 18px;

  border-radius: 9px;

  background: #f4f8fb;

  border: 1px solid #dce8f1;
}

.recomendaciones strong {
  display: block;

  margin-bottom: 12px;

  color: var(--obrax-blue);

  font-size: 12px;
}

.recomendaciones ul {
  margin: 0;

  padding-left: 17px;

  color: var(--obrax-text-soft);

  font-size: 11px;

  line-height: 1.8;
}


/* =========================================================
   ERRORES
   ========================================================= */

.error-msg {
  display: none;

  margin: 8px 0;

  padding: 10px 12px;

  border-radius: 7px;

  background: #fff1f1;

  border: 1px solid #f1caca;

  color: var(--obrax-danger);

  font-size: 12px;
}

.error-msg.show {
  display: block;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 950px) {

  body.has-sidebar {
    padding-left: 0;
  }

  .obrax-sidebar {
    width: 220px;
  }

  body.has-sidebar {
    padding-left: 220px;
  }

  .perfil-grid {
    grid-template-columns: 1fr;
  }

  .seguridad-grid {
    grid-template-columns: 1fr;
  }

}


@media (max-width: 700px) {

  body.has-sidebar {
    padding-left: 0;
  }

  .obrax-sidebar {
    position: relative;

    width: 100%;

    min-height: auto;
  }

  .sidebar-nav {
    max-height: none;
  }

  .sidebar-bottom {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .perfil-container {
    width: calc(100% - 28px);

    padding-top: 24px;
  }

  .perfil-hero {
    flex-direction: column;

    align-items: flex-start;
  }

  .perfil-frase {
    width: 100%;

    padding-left: 0;
    padding-top: 18px;

    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.18);

    text-align: left;
  }

  .password-grid {
    grid-template-columns: 1fr;
  }

  .password-grid .full {
    grid-column: auto;
  }

}
/* =========================================================
   DASHBOARD OBRAX
   ========================================================= */

.container {
  width: min(100% - 56px, 1100px);
  margin: 0 auto;
  padding: 34px 0 60px;
}


/* =========================================================
   DASHBOARD HEADER
   ========================================================= */

.container > .page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 26px;
}

.container > .page-head h1 {
  margin: 0;

  font-family: var(--font-display);

  font-size: 38px;
  line-height: 1;

  color: var(--obrax-text);
}

.container > .page-head .subtitle {
  margin-top: 8px;
}


/* =========================================================
   BOTÓN NUEVO PROYECTO
   ========================================================= */

.btn {
  min-height: 40px;

  padding: 0 17px;

  border: 0;
  border-radius: 7px;

  background: var(--obrax-orange);

  color: #ffffff;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  transition: all .18s ease;
}

.btn:hover {
  background: var(--obrax-orange-dark);

  transform: translateY(-1px);
}

.btn.secondary {
  background: #ffffff;

  border: 1px solid var(--obrax-border);

  color: var(--obrax-text);
}

.btn.secondary:hover {
  background: var(--obrax-blue-light);

  color: var(--obrax-blue);
}


/* =========================================================
   KPIs
   ========================================================= */

.dashboard-summary {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 22px;
}

.summary-card {
  position: relative;

  min-height: 128px;

  padding: 20px;

  background: #ffffff;

  border: 1px solid var(--obrax-border);

  border-radius: 10px;

  box-shadow: var(--shadow);

  overflow: hidden;
}

.summary-card::before {
  content: "";

  position: absolute;

  left: 0;
  top: 0;
  bottom: 0;

  width: 4px;

  background: var(--obrax-blue);
}

.summary-card:nth-child(3)::before {
  background: var(--obrax-orange);
}

.summary-card:nth-child(4)::before {
  background: var(--obrax-success);
}

.summary-card > span {
  display: block;

  margin-bottom: 10px;

  color: var(--obrax-text-soft);

  font-size: 11px;
  font-weight: 600;

  text-transform: uppercase;

  letter-spacing: .4px;
}

.summary-card strong {
  display: block;

  font-family: var(--font-display);

  font-size: 30px;

  line-height: 1;

  color: var(--obrax-text);
}

.summary-card small {
  display: block;

  margin-top: 10px;

  color: var(--obrax-muted);

  font-size: 10px;
}

#kpiDisponible.negative {
  color: var(--obrax-danger);
}


/* =========================================================
   ALERTAS + ÚLTIMOS GASTOS
   ========================================================= */

.dashboard-columns {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 20px;

  margin-bottom: 28px;
}

.card {
  background: #ffffff;

  border: 1px solid var(--obrax-border);

  border-radius: 10px;

  box-shadow: var(--shadow);

  padding: 22px;
}

.card-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 18px;
}

.card-header h2 {
  margin: 0;

  font-family: var(--font-display);

  font-size: 22px;

  line-height: 1;

  color: var(--obrax-text);
}

.section-note {
  color: var(--obrax-muted);

  font-size: 10px;
}


/* =========================================================
   LISTA DE ALERTAS
   ========================================================= */

.attention-list,
.recent-list {
  display: flex;

  flex-direction: column;
}

.attention-item,
.recent-item {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 15px;

  padding: 13px 4px;

  border-top: 1px solid #edf1f4;

  text-decoration: none;

  color: var(--obrax-text);
}

.attention-item:first-child,
.recent-item:first-child {
  border-top: 0;
}

.attention-item:hover,
.recent-item:hover {
  background: #f8fafc;

  padding-left: 8px;
  padding-right: 8px;
}

.attention-item span,
.recent-item span {
  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 4px;
}

.attention-item strong,
.recent-item strong {
  overflow: hidden;

  white-space: nowrap;

  text-overflow: ellipsis;

  font-size: 12px;
}

.attention-item small,
.recent-item small {
  color: var(--obrax-muted);

  font-size: 10px;
}

.attention-item b,
.recent-item b {
  flex-shrink: 0;

  font-family: var(--font-mono);

  font-size: 11px;
}

.warn-text {
  color: #c58a1d;
}

.danger-text {
  color: var(--obrax-danger);
}

.muted {
  padding: 16px 4px;

  color: var(--obrax-muted);

  font-size: 12px;
}


/* =========================================================
   BARRA DE PROYECTOS
   ========================================================= */

.project-toolbar {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 16px;
}

.project-toolbar h2 {
  margin: 0;

  font-family: var(--font-display);

  font-size: 27px;

  line-height: 1;

  color: var(--obrax-text);
}

.project-filters {
  display: flex;

  align-items: center;

  gap: 9px;
}

.project-filters input {
  width: 240px;
}

.project-filters select {
  width: 180px;
}


/* =========================================================
   GRID DE PROYECTOS
   ========================================================= */

.proyecto-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 17px;
}

.proyecto-card {
  position: relative;

  padding: 21px;

  background: #ffffff;

  border: 1px solid var(--obrax-border);

  border-radius: 10px;

  box-shadow: var(--shadow);

  cursor: pointer;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.proyecto-card:hover {
  transform: translateY(-2px);

  box-shadow: var(--shadow-hover);

  border-color: #cbd9e5;
}

.proyecto-card h3 {
  margin: 13px 0 5px;

  font-family: var(--font-display);

  font-size: 23px;

  line-height: 1.05;

  color: var(--obrax-text);
}

.proyecto-card .cliente {
  margin-bottom: 14px;

  color: var(--obrax-text-soft);

  font-size: 11px;
}


/* =========================================================
   ESTADOS
   ========================================================= */

.estado {
  display: inline-flex;

  align-items: center;

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 9px;
  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: .5px;
}

.estado.activo {
  background: #e8f6ef;

  color: var(--obrax-success);
}

.estado.pausado {
  background: #fff5df;

  color: #a87618;
}

.estado.terminado {
  background: #edf1f4;

  color: #697987;
}


/* =========================================================
   GAUGE
   ========================================================= */

.gauge {
  width: 100%;

  height: 7px;

  margin-top: 16px;

  overflow: hidden;

  border-radius: 10px;

  background: #e9eef2;
}

.gauge-fill {
  height: 100%;

  border-radius: inherit;

  background: var(--obrax-blue);

  transition: width .3s ease;
}

.gauge-fill.warn {
  background: #d59b2a;
}

.gauge-fill.danger {
  background: var(--obrax-danger);
}

.gauge-labels {
  display: flex;

  justify-content: space-between;

  gap: 10px;

  margin-top: 7px;

  color: var(--obrax-muted);

  font-size: 10px;
}

.mono {
  font-family: var(--font-mono);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
  padding: 50px 20px;

  text-align: center;

  background: #ffffff;

  border: 1px dashed #ccd7e0;

  border-radius: 10px;
}

.empty-state h3 {
  margin: 0 0 7px;

  font-family: var(--font-display);

  font-size: 23px;

  color: var(--obrax-text);
}

.empty-state p {
  margin: 0;

  color: var(--obrax-text-soft);

  font-size: 12px;
}


/* =========================================================
   MODAL NUEVO PROYECTO
   ========================================================= */

.modal-overlay {
  position: fixed;

  inset: 0;

  z-index: 2000;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(13, 35, 54, .52);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  width: min(100%, 520px);

  max-height: calc(100vh - 40px);

  overflow-y: auto;

  padding: 27px;

  background: #ffffff;

  border-radius: 12px;

  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.modal h2 {
  margin-top: 0;

  font-family: var(--font-display);

  font-size: 27px;

  color: var(--obrax-text);
}

.modal > form > label {
  display: block;

  margin: 14px 0 6px;

  color: var(--obrax-text-soft);

  font-size: 10px;
  font-weight: 600;

  text-transform: uppercase;

  letter-spacing: .4px;
}

.modal-actions {
  display: flex;

  justify-content: flex-end;

  gap: 9px;

  margin-top: 20px;
}


/* =========================================================
   RESPONSIVE DASHBOARD
   ========================================================= */

@media (max-width: 1050px) {

  .dashboard-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .proyecto-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}


@media (max-width: 800px) {

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .project-toolbar {
    align-items: stretch;

    flex-direction: column;
  }

  .project-filters {
    width: 100%;
  }

  .project-filters input,
  .project-filters select {
    width: 100%;
  }

}


@media (max-width: 650px) {

  .container {
    width: calc(100% - 28px);

    padding-top: 24px;
  }

  .container > .page-head {
    align-items: stretch;

    flex-direction: column;
  }

  .container > .page-head .btn {
    width: 100% !important;
  }

  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .proyecto-grid {
    grid-template-columns: 1fr;
  }

  .project-filters {
    flex-direction: column;
  }

  .project-filters input,
  .project-filters select {
    width: 100%;
  }

}
/* =========================================================
   DETALLE DE PROYECTO
   ========================================================= */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  position: relative;

  min-height: 118px;
  padding: 20px;

  background: #ffffff;

  border: 1px solid var(--obrax-border);
  border-radius: 10px;

  box-shadow: var(--shadow);

  overflow: hidden;
}

.stat::before {
  content: "";

  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;

  width: 4px;

  background: var(--obrax-blue);
}

.stat:nth-child(2)::before {
  background: var(--obrax-orange);
}

.stat:nth-child(3)::before {
  background: var(--obrax-success);
}

.stat.over::before {
  background: var(--obrax-danger);
}

.stat .label {
  margin-bottom: 10px;

  color: var(--obrax-text-soft);

  font-size: 10px;
  font-weight: 600;

  text-transform: uppercase;
  letter-spacing: .5px;
}

.stat .value {
  font-family: var(--font-display);

  font-size: 30px;
  font-weight: 700;

  line-height: 1;

  color: var(--obrax-text);
}

.stat.over .value {
  color: var(--obrax-danger);
}


/* =========================================================
   RESUMEN DE CATEGORÍAS
   ========================================================= */

.resumen-categorias {
  margin-bottom: 20px;
}

.categoria-resumen-item {
  padding: 12px 0;

  border-top: 1px solid #edf1f4;
}

.categoria-resumen-item:first-child {
  border-top: 0;
}

.categoria-resumen-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 7px;

  font-size: 12px;
}

.categoria-resumen-head span {
  color: var(--obrax-text);
  font-weight: 500;
}

.categoria-resumen-head strong {
  color: var(--obrax-text-soft);

  font-family: var(--font-mono);

  font-size: 10px;
}

.resumen-categorias .gauge {
  margin-top: 0;
}


/* =========================================================
   TABLA DE GASTOS
   ========================================================= */

#tablaGastos {
  width: 100%;

  border-collapse: collapse;

  font-size: 12px;
}

#tablaGastos thead th {
  padding: 11px 10px;

  border-bottom: 1px solid var(--obrax-border);

  color: var(--obrax-text-soft);

  font-size: 10px;
  font-weight: 600;

  text-align: left;

  text-transform: uppercase;

  letter-spacing: .35px;

  white-space: nowrap;
}

#tablaGastos tbody td {
  padding: 14px 10px;

  border-bottom: 1px solid #edf1f4;

  vertical-align: top;

  color: var(--obrax-text);
}

#tablaGastos tbody tr:hover {
  background: #f8fafc;
}

#tablaGastos .monto {
  text-align: right;

  font-family: var(--font-mono);

  font-size: 11px;
  font-weight: 500;

  white-space: nowrap;
}

.categoria-tag {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 5px;

  background: var(--obrax-blue-light);

  color: var(--obrax-blue);

  font-size: 9px;
  font-weight: 600;
}


/* =========================================================
   BOTÓN ELIMINAR
   ========================================================= */

.icon-btn {
  padding: 6px 9px;

  border: 1px solid #e7caca;

  border-radius: 6px;

  background: #fff5f5;

  color: var(--obrax-danger);

  font-size: 10px;

  cursor: pointer;
}

.icon-btn:hover {
  background: #ffe9e9;
}


/* =========================================================
   BOTÓN PEQUEÑO
   ========================================================= */

.btn.small {
  min-height: 34px;

  padding: 0 12px;

  font-size: 10px;
}


/* =========================================================
   MODAL GASTO
   ========================================================= */

.modal-gasto {
  width: min(100%, 720px);
}

.gasto-header {
  margin-bottom: 24px;
}

.gasto-kicker {
  margin-bottom: 5px;

  color: var(--obrax-orange);

  font-family: var(--font-mono);

  font-size: 9px;
  font-weight: 600;

  letter-spacing: 1.1px;
}

.gasto-header h2 {
  margin-bottom: 5px;
}

.gasto-header p {
  margin: 0;

  color: var(--obrax-text-soft);

  font-size: 12px;
}

.form-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 0 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}


/* =========================================================
   INPUT MONEDA
   ========================================================= */

.input-money {
  position: relative;
}

.input-money > span {
  position: absolute;

  left: 12px;
  top: 50%;

  transform: translateY(-50%);

  color: var(--obrax-text-soft);

  font-size: 13px;

  pointer-events: none;
}

.input-money input {
  padding-left: 27px;
}


/* =========================================================
   UPLOAD
   ========================================================= */

.upload-box {
  position: relative;

  min-height: 74px;

  display: flex;
  align-items: center;

  border: 1px dashed #b9c9d7;

  border-radius: 8px;

  background: #f8fafc;

  overflow: hidden;
}

.upload-box input[type="file"] {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  opacity: 0;

  cursor: pointer;
}

.upload-content {
  display: flex;
  align-items: center;

  gap: 12px;

  padding: 15px;
}

.upload-icon {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: var(--obrax-blue-light);

  font-size: 17px;
}

.upload-content strong {
  display: block;

  color: var(--obrax-text);

  font-size: 11px;
}

.upload-content span {
  display: block;

  margin-top: 3px;

  color: var(--obrax-muted);

  font-size: 10px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 850px) {

  .stats-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }

  #tablaGastos {
    min-width: 760px;
  }

  .card:has(#tablaGastos) {
    overflow-x: auto;
  }

}

@media (max-width: 600px) {

  .page-head {
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-head > div:last-child {
    width: 100%;
  }

  .page-head > div:last-child .btn {
    flex: 1;
  }

}
/* =========================================================
   PROYECTO — TARJETAS DE ESTADÍSTICAS
   ========================================================= */

.stats-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;

  margin: 22px 0 !important;
}

.stats-row .stat {
  position: relative;

  display: block;

  min-height: 118px;

  padding: 20px 22px !important;

  background: #ffffff !important;

  border: 1px solid var(--obrax-border) !important;
  border-radius: 10px !important;

  box-shadow: var(--shadow);

  overflow: hidden;
}

.stats-row .stat::before {
  content: "";

  position: absolute;

  left: 0;
  top: 0;
  bottom: 0;

  width: 4px;

  background: var(--obrax-blue);
}

.stats-row .stat:nth-child(2)::before {
  background: var(--obrax-orange);
}

.stats-row .stat:nth-child(3)::before {
  background: var(--obrax-success);
}

.stats-row .stat.over::before {
  background: var(--obrax-danger);
}

.stats-row .stat .label {
  display: block;

  margin: 0 0 10px;

  color: var(--obrax-text-soft);

  font-size: 10px;
  font-weight: 600;

  text-transform: uppercase;
  letter-spacing: .5px;
}

.stats-row .stat .value {
  display: block;

  margin: 0;

  font-family: var(--font-display);

  font-size: 30px;
  font-weight: 700;

  line-height: 1;

  color: var(--obrax-text);
}

.stats-row .stat.over .value {
  color: var(--obrax-danger);
}


/* =========================================================
   ENCABEZADO DEL PROYECTO
   ========================================================= */

.container > .page-head {
  margin-bottom: 4px;
}

.container > .page-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 38px;
}

.container > .page-head .subtitle {
  margin-top: 7px;
}


/* =========================================================
   DISTRIBUCIÓN
   ========================================================= */

.resumen-categorias {
  margin-bottom: 18px;
}

.resumen-categorias .card-header {
  margin-bottom: 14px;
}

.resumen-categorias .categoria-resumen-item {
  padding: 10px 0;
}

.resumen-categorias .categoria-resumen-head {
  margin-bottom: 6px;
}


/* =========================================================
   GASTOS
   ========================================================= */

.card:has(#tablaGastos) {
  overflow: hidden;
}

.card:has(#tablaGastos) .card-header {
  margin-bottom: 10px;
}

#tablaGastos {
  table-layout: auto;
}

#tablaGastos thead th {
  padding: 12px 10px;
}

#tablaGastos tbody td {
  padding: 13px 10px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

  .stats-row {
    grid-template-columns: 1fr !important;
  }

}

@media (max-width: 600px) {

  .container > .page-head h1 {
    font-size: 32px;
  }

}
/* =========================================================
   PROYECTO — STATS DEFINITIVOS
   ========================================================= */

.stats-row {
    width: 100% !important;

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    gap: 16px !important;

    margin: 24px 0 !important;
}

.stats-row > .stat {
    position: relative !important;

    width: auto !important;
    min-width: 0 !important;
    min-height: 120px !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;

    padding: 20px 22px !important;

    background: #ffffff !important;

    border: 1px solid #dce4eb !important;
    border-radius: 10px !important;

    box-shadow: 0 4px 18px rgba(20, 45, 70, 0.07) !important;

    overflow: hidden !important;
}

.stats-row > .stat::before {
    content: "" !important;

    position: absolute !important;

    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;

    width: 4px !important;

    background: #173f67 !important;
}

.stats-row > .stat:nth-child(2)::before {
    background: #f28c28 !important;
}

.stats-row > .stat:nth-child(3)::before {
    background: #16845b !important;
}

.stats-row > .stat.over::before {
    background: #c63c3c !important;
}

.stats-row > .stat .label {
    display: block !important;

    margin: 0 0 9px !important;

    color: #667789 !important;

    font-family: 'Inter', sans-serif !important;

    font-size: 10px !important;
    font-weight: 600 !important;

    text-transform: uppercase !important;
    letter-spacing: .5px !important;
}

.stats-row > .stat .value {
    display: block !important;

    margin: 0 !important;

    color: #172b3a !important;

    font-family: 'Barlow Condensed', sans-serif !important;

    font-size: 32px !important;
    font-weight: 700 !important;

    line-height: 1 !important;
}

.stats-row > .stat.over .value {
    color: #c63c3c !important;
}

@media (max-width: 800px) {
    .stats-row {
        grid-template-columns: 1fr !important;
    }
}