/* =========================================================
   MODAL ROOT
========================================================= */

#modal-container {
    position: fixed;
    inset: 0;

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

    background: rgba(0,0,0,.75);

    z-index: 999999;
}

/* =========================================================
   MODAL WINDOW
========================================================= */

.simulation-modal {

    width: 95vw;
    max-width: 1400px;

    height: 90vh;

    background: #0f172a;

    border-radius: 14px;

    overflow: hidden;

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

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

.simulation-container {

    display: grid;

    grid-template-columns:
        260px
        1fr
        360px;

    gap: 16px;

    height: 100%;

    padding: 16px;

    background: #0f172a;
}

/* =========================================================
   COLUMNS
========================================================= */

.column-left,
.column-center,
.column-right{

    display:flex;
    flex-direction:column;

    min-height:0;

    background:#18233d;

    border:1px solid rgba(255,255,255,.08);

    border-radius:12px;
}

/* =========================================================
   LEFT COLUMN
========================================================= */

.column-left{

    overflow-y:auto;
    overflow-x:hidden;

}

/* =========================================================
   CENTER COLUMN
========================================================= */

.column-center{

    overflow:hidden;

}

/* =========================================================
   RIGHT COLUMN
========================================================= */

.column-right{

    overflow:hidden;

}

/* =========================================================
   HEADERS
========================================================= */

.column-header{

    flex-shrink:0;

    padding-bottom:12px;

    margin-bottom:12px;

    border-bottom:1px solid rgba(255,255,255,.08);

    background:#18233d;

    z-index:5;

}

/* =========================================================
   SCROLL AREA
========================================================= */

.column-scroll{

    flex:1;

    min-height:0;

    overflow-y:auto;

    overflow-x:hidden;

    padding-right:8px;

}

/* =========================================================
   SCROLLBAR
========================================================= */

.column-scroll::-webkit-scrollbar{

    width:8px;

}

.column-scroll::-webkit-scrollbar-track{

    background:transparent;

}

.column-scroll::-webkit-scrollbar-thumb{

    background:#4f8cff;

    border-radius:20px;

}

.column-scroll::-webkit-scrollbar-thumb:hover{

    background:#66a3ff;

}

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

.modal-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 16px;
}

.modal-header h2 {

    color: white;

    margin: 0;

    font-size: 28px;
}

/* =========================================================
   TITLES
========================================================= */

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #7aa7ff;
    margin: 10px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================================================
   INPUTS
========================================================= */

#modal-container input:not([type="checkbox"]),
#modal-container select{

    width:100%;

    box-sizing:border-box;

    height:42px;

    padding:10px 14px;

    border-radius:8px;

    border:none;

    font-size:14px;

}

#projectName{
    height:46px;
    font-size:15px;
    margin-bottom:18px;
}

/* =========================================================
   STAGES
========================================================= */

#stagesContainer {

    display: flex;

    flex-direction: column;

    gap: 8px;
}

.stage-item{

    display:grid;

    grid-template-columns:
        20px
        1fr
        auto;

    align-items:center;

    gap:8px;

    padding:4px 0;
    font-size: 14px;

    color:white;
    border-radius:8px;

    transition:.2s; 
}

.stage-item input[type="checkbox"] {

    width: 16px;

    height: 16px;

    margin: 0;
}


.stage-item:hover{

    background:rgba(255,255,255,.05);
}

.stage-name{

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;
}

.stage-days{

    color:#8fa5d6;

    font-size:12px;
}


/* =========================================================
   BUTTONS
========================================================= */

#btnCloseModal {

    width: 36px;

    height: 36px;

    border: none;

    border-radius: 8px;

    background: #4f8cff;

    color: white;

    cursor: pointer;
}

#btnSimulate{

    width:100%;

    margin-top:auto;

    margin-bottom:10px;

    padding:12px;

    border:none;

    border-radius:10px;

    background:#4f8cff;

    color:white;

    cursor:pointer;

    flex-shrink:0;

}

/* =========================================================
   PARAMETERS
========================================================= */

.parameter-group {

    background: #10182c;

    border-radius: 10px;

    padding: 14px;

    margin-bottom: 16px;
}

/* =========================================================
   RESULTS
========================================================= */

.result-card {

    background: #10182c;

    border-radius: 10px;

    padding: 14px;

    color: white;
}

.form-row{

    display:grid;

    grid-template-columns:
      repeat(auto-fit,minmax(120px,1fr));

    gap:8px;

    margin-bottom:10px;
}


.mini-grid{

  display:grid;
  grid-template-columns:
      repeat(auto-fit,minmax(140px,1fr));

  gap:12px;

  margin-bottom:16px;
}

.form-grid-2{

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

  gap:12px;

  margin-bottom:16px;
}

.mini-input{

  display:flex;
  flex-direction:column;
}

.mini-input label {
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
}


.mini-input small{

  color:#8ea2c8;
  font-size:11px;

  margin-top:4px;
}

.mini-input input,
.mini-input select{

  margin:0;
}

.mini-field{

  display:flex;
  flex-direction:column;
}

.mini-field label{

  color:white;
  font-size:13px;
  margin-bottom:4px;
}

.mini-field small{

  color:#8ea2c8;
  font-size:11px;
  margin-top:4px;
}

.mini-field input{

  margin:0;
}

.simulation-card {

  background: #18233f;

  border-radius: 10px;

  padding: 15px;

  margin-bottom: 15px;
}

.calc-row {

  display: flex;

  justify-content: space-between;

  margin: 6px 0;

  font-size: 13px;
}

.calc-total {

  text-align: right;

  font-size: 20px;

  font-weight: bold;

  color: #58a6ff;
}

.result-total{

    margin-top:22px;

    padding:22px;

    background:linear-gradient(
        180deg,
        #111b31,
        #0c1324
    );

    border:1px solid rgba(88,166,255,.25);

    border-radius:14px;

    text-align:center;

}

.hours{

    font-size:34px;

    font-weight:800;

    color:#58a6ff;

    margin-top:10px;

}
.result-total h3{

    font-size:13px;

    letter-spacing:.12em;

    text-transform:uppercase;

    color:#8ea2c8;

}

.parameter-card{

    background:#101a30;
    border:1px solid rgba(79,140,255,.20);
    border-radius:14px;

    padding:16px;
    margin-bottom:14px;

    box-shadow:0 6px 16px rgba(0,0,0,.25);

    transition:.2s ease;
}

.parameter-card:hover{
    transform: translateY(-1px);
    border-color: rgba(79,140,255,.35);
}


/* =========================
   SIMULATION UX FIX
========================= */

.result-panel{
  background:#151d33;
  border:1px solid rgba(255,255,255,.06);
  border-radius:12px;
  padding:14px;
  margin-bottom:14px;
}

.result-title{
  font-size:14px;
  font-weight:700;
  margin-bottom:10px;
  color:#e5e7eb;
}

.result-panel hr{
  border:none;
  border-top:1px solid rgba(255,255,255,.08);
  margin:10px 0;
}

.result-total{
  margin-top:18px;
  padding:14px;

  background:#0f172a;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;

  text-align:center;
}

.result-total h3{
  margin:0 0 6px 0;
  font-size:13px;
  color:#94a3b8;
  font-weight:600;
  letter-spacing:.08em;
}

.hours{
  font-size:22px;
  font-weight:800;
  color:#58a6ff;
}

/*==============================*/
/* RESULT GROUPS                */
/*==============================*/

.result-group{

    margin-top:16px;

    padding-top:12px;

    border-top:1px solid rgba(255,255,255,.08);

}

#simulationResult {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.group-title{

    font-size:13px;

    font-weight:700;

    color:#5fb3ff;

    margin-bottom:8px;

    text-transform:uppercase;

    letter-spacing:.5px;

}

.metric{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:4px 0;

    font-size:13px;

}

.metric span{

    color:#d7dbe3;

}

.metric b{

    color:#ffffff;

}

.total-group{

    margin-top:22px;

    border-top:2px solid rgba(255,255,255,.18);

}

.total-line{

    font-size:15px;

    font-weight:700;

}

/* =========================================================
   UX V1.0
   HEADERS + SCROLLS
=========================================================*/

.simulation-modal{

    display:flex;
    flex-direction:column;

    overflow:hidden;
}

.simulation-container{

    display:grid;

    grid-template-columns:
        260px
        1fr
        360px;

    gap:16px;

    flex:1;

    min-height:0;
}


#parameterContent{

    flex:1;

    overflow-y:auto;

    overflow-x:hidden;

    padding-right:10px;

    min-height:0;

}


/*----------------------------------
 STONE EXTRAS
-----------------------------------*/

.subsection-title{

    margin:18px 0 12px;

    font-size:28px;

    color:#ffffff;

    font-weight:500;
}

.mini-input label{

    white-space:nowrap;
}

/*----------------------------------
 MEJOR ESPACIADO
-----------------------------------*/

.parameter-card{

    margin-bottom:18px;
}

.result-panel{

    margin-bottom:18px;
}

#parameterContent{

    flex:1;

    overflow-y:auto;

    padding-right:8px;

    min-height:0;

}

/*==================================
  SUBTOTAL CARD
==================================*/

.summary-card{

    margin-top:18px;

    padding:16px;

    background:#11192d;

    border:1px solid rgba(88,166,255,.18);

    border-radius:12px;

}

.summary-title{

    text-align:center;

    font-size:12px;

    text-transform:uppercase;

    letter-spacing:.10em;

    color:#8ea2c8;

    margin-bottom:12px;

    font-weight:700;

}

.summary-row{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin:8px 0;

}

.summary-label{

    color:#d6dceb;

    font-size:14px;

    font-weight:600;

}

.summary-value{

    color:#ffffff;

    font-size:18px;

    font-weight:700;

}

/*========================================
  GANTT PRO SYSTEM (FINAL CLEAN)
========================================*/

/* ROOT */
#ganttView {
  margin-top: 12px;
  height: 100%;
}

/* WRAPPER */
.gantt-pro {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}

/*========================
  HEADER (TIMELINE)
========================*/
.gantt-header {
  display: grid;
  grid-auto-flow: column;
  gap: 2px;

  padding: 8px;
  background: #111c33;

  position: sticky;
  top: 0;
  z-index: 10;

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

.gantt-day {
  font-size: 11px;
  text-align: center;
  color: #94a3b8;
}

/*========================
  BODY (SCROLL AREA)
========================*/
.gantt-body {
  overflow: auto;
  flex: 1;
}

/*========================
  ROW (RESOURCE)
========================*/
.gantt-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;

  min-height: 44px;

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

.gantt-row:hover {
  background: rgba(255,255,255,0.03);
}

/* RESOURCE LABEL */
.gantt-label {
  padding: 8px;
  font-size: 12px;
  color: #cbd5e1;

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

/*========================
  TRACK (TIMELINE AREA)
========================*/
.gantt-track {
  position: relative;
  height: 30px;

  background: rgba(255,255,255,0.02);
  border-radius: 6px;

  overflow: hidden;
}

/*========================
  BAR (TASK BLOCK)
========================*/
.gantt-bar {
  position: absolute;

  height: 18px;
  top: 6px;

  display: flex;
  align-items: center;

  padding: 0 6px;

  font-size: 10px;
  color: white;

  background: linear-gradient(90deg, #4f8cff, #2563eb);
  border-radius: 6px;

  overflow: hidden;
  white-space: nowrap;

  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* optional hover */
.gantt-bar:hover {
  filter: brightness(1.15);
  cursor: pointer;
}
