/* ================== CTH Home ================== */
:root{
  --home-font-family: var(--bs-font-sans-serif);
  --home-weight-regular: 400;
  --home-weight-medium: 500;
  --home-weight-bold: 700;

  --home-block-border: #666;
  --home-block-bg: #ddd;
  --home-block-radius: .5em;
  --home-block-padding: 5px;
  --home-block-margin: 1em;

  --home-panel-border: #b7b7b7;
  --home-panel-bg: #eceff1;
  --home-panel-radius: .45em;

  --home-header-top: #0f2741;
  --home-header-bot: #0d2340;

  --home-app-size: 132px;
  --home-app-top: #18324e;
  --home-app-bot: #222629;
  --home-app-top-hover: var(--color-primary, #213f63);
  --home-app-bot-hover: #3c4856;

  /* label 2 líneas */
  --home-app-label-h: 46px;
  --home-app-label-gap: 10px;
  --home-app-label-size: .62rem;
  --home-app-label-track: .02em;

  --home-app-icon-size: 3.2rem;

  --home-white: #fff;
  --home-text: #1e293b;
}

/* ===== Fondo general con pequeño degradado azul oscuro (siempre presente) */
#cth-home{
  font-family: var(--home-font-family);
  font-weight: var(--home-weight-regular);
  color: var(--home-text);
  background: linear-gradient(180deg, rgba(15,39,65,.14), rgba(15,39,65,0) 240px) no-repeat;
}

/* ===== BLOQUE DE BIENVENIDA ===== */
.cth-welcome{
  border-radius: 14px 14px 0 0; /* solo esquinas superiores */
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}

/* 🔹 Franja única (gradiente azul) */
.cth-welcome__bar{
  min-height: 74px;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--home-header-top), var(--home-header-bot));
}

/* centro: logo + puntos + título, todo centrado */
.cth-welcome__center{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 24px);
}
.cth-welcome__logo{
  height: clamp(34px, 5vw, 64px);
  width: auto;
  object-fit: contain;
  filter: brightness(105%);
}

/* tres puntos (verticales) */
.cth-welcome__dots{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, .6vw, 8px);
  height: clamp(26px, 4.6vw, 42px);
  margin-inline: 2px;
}
.cth-welcome__dots i{
  display: block;
  width: clamp(5px, .6vw, 8px);
  height: clamp(5px, .6vw, 8px);
  border-radius: 50%;
  background: rgba(255,255,255,.9);
}

/* título blanco y centrado */
.cth-welcome__title{
  margin: 0;
  color: #fff !important;
  text-align: center;
  font-weight: 600;
  letter-spacing: .01em;
  font-size: clamp(1.4rem, 3.4vw, 3rem);
}

/* franja de versión */
.cth-welcome__foot{
  height: 44px;
  background: #0f0f0f;
}

/* ===== BLOQUES ===== */
.cth-block{
  border: 2px solid var(--home-block-border);
  background-color: var(--home-block-bg);
  border-radius: var(--home-block-radius);
  padding: var(--home-block-padding);
  margin: var(--home-block-margin) 0;
  cursor: default;
}
.cth-block[draggable="true"]{ cursor: move; }

.cth-panel{
  background: var(--home-panel-bg);
  border: 1px solid var(--home-panel-border);
  border-radius: var(--home-panel-radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* header azul del bloque */
.cth-panel__header{
  display:flex; align-items:center; gap:.6rem;
  min-height: 52px;
  padding: .6rem .9rem;
  background: linear-gradient(180deg, var(--home-header-top), var(--home-header-bot));
  color: var(--home-white) !important;
}
.cth-panel__header .cth-panel__title{
  margin:0;
  font-size:1.05rem;
  font-weight: var(--home-weight-bold);
  letter-spacing:.02em;
  color: var(--home-white) !important;
}

.cth-block__handle{
  width:22px; height:22px;
  display:grid; place-items:center;
  border:1px dashed rgba(255,255,255,.5);
  border-radius:4px;
  cursor:grab; user-select:none;
  font-weight: var(--home-weight-bold);
}
.cth-block__handle:active{ cursor:grabbing; }

.cth-panel__body{
  background: var(--home-panel-bg);
  padding: 1rem .9rem 1.1rem;
}

/* ===== TILES ===== */
.cth-buttons{
  display:flex;
  flex-wrap:wrap;
  gap: 18px;
  justify-content:flex-start;
}
@media (max-width: 991.98px){
  .cth-buttons{ justify-content:center; }
}

.cth-app{
  position: relative;
  width: var(--home-app-size);
  aspect-ratio: 1/1;
  border-radius: .75rem;
  border: 1px solid rgba(0,0,0,.28);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display:flex; align-items:center; justify-content:center;

  padding-bottom: calc(var(--home-app-label-h) + var(--home-app-label-gap));

  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  background: linear-gradient(to bottom, var(--home-app-top) 0 50%, var(--home-app-bot) 50% 100%);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.cth-app__icon{ font-size: var(--home-app-icon-size); opacity:.95; }

/* label */
.cth-app__label{
  position: absolute; left: 0; right: 0;
  bottom: var(--home-app-label-gap);
  height: var(--home-app-label-h);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  width: calc(100% - 18px);
  margin: 0 auto;
  padding: .18rem .50rem;
  border-radius: .4rem;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
}
.cth-app__label-text{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  width: 100%;

  text-transform: uppercase;
  color: rgba(255,255,255,.92);
  font-size: var(--home-app-label-size);
  font-weight: var(--home-weight-medium);
  letter-spacing: var(--home-app-label-track);
  line-height: 1.15;
}

/* hover de tile */
.cth-app:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.24);
  background: linear-gradient(to bottom, var(--home-app-top-hover) 0 50%, var(--home-app-bot-hover) 50% 100%);
}

/* drag feedback */
#cth-blocks .cth-block.dragging{ opacity:.86; outline: 2px dashed #2d4f7a; }
.cth-placeholder{
  height: 84px;
  border: 2px dashed #2d4f7a;
  border-radius: .75rem;
  background: rgba(33,63,99,.06);
  margin: .25rem 0;
}

/* responsive micro-ajustes */
@media (max-width: 576px){
  :root{
    --home-app-size: 118px;
    --home-app-icon-size: 2.6rem;
    --home-app-label-h: 42px;
    --home-app-label-size: .6rem;
  }
}
