/* Galimplant Trabajos — Public CSS */

:root {
    --gj-primary:   #0A2540;
    --gj-secondary: #00AEEF;
    --gj-light:     #F5F7FA;
    --gj-white:     #FFFFFF;
    --gj-border:    #E5E7EB;
    --gj-success:   #22C55E;
    --gj-warning:   #F59E0B;
    --gj-danger:    #EF4444;

    --gj-text:        #0A2540;
    --gj-text-muted:  #6B7280;
    --gj-radius:      10px;
    --gj-radius-lg:   14px;
    --gj-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── Topbar Área Clínica ─────────────────────────────────────────────────── */

.gj-topbar {
    background: var(--gj-white);
    border-bottom: 1px solid var(--gj-border);
    font-family: var(--gj-font);
}

.gj-topbar__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gj-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gj-topbar__logo {
    height: 32px;
    width: auto;
    display: block;
}

.gj-topbar__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gj-primary);
    letter-spacing: -0.01em;
}

.gj-topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gj-topbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gj-topbar__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gj-secondary);
    color: var(--gj-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.gj-topbar__name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gj-primary);
}

.gj-topbar__logout {
    font-size: 0.78rem;
    color: var(--gj-text-muted);
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid var(--gj-border);
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

.gj-topbar__logout:hover {
    background: var(--gj-light);
    color: var(--gj-danger);
    border-color: var(--gj-danger);
}

@media (max-width: 480px) {
    .gj-topbar__inner { padding: 10px 14px; }
    .gj-topbar__title { font-size: 0.82rem; }
    .gj-topbar__name  { display: none; }
}

/* ─── Avisos ─────────────────────────────────────────────────────────────── */

.galimplant-notice {
    padding: 12px 16px;
    border-radius: var(--gj-radius);
    margin-bottom: 20px;
}
.galimplant-notice--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.galimplant-notice--warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.galimplant-notice--error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ─── Botones ────────────────────────────────────────────────────────────── */

.galimplant-btn {
    display: inline-block;
    background: var(--gj-secondary);
    color: var(--gj-white);
    border: none;
    padding: 10px 22px;
    border-radius: var(--gj-radius);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, transform 0.1s;
}
.galimplant-btn:hover { background: #0095cc; color: var(--gj-white); }
.galimplant-btn:active { transform: scale(0.98); }

.galimplant-btn--sm { padding: 6px 14px; font-size: 0.85rem; }

.galimplant-btn--download {
    background: var(--gj-success);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.galimplant-btn--download:hover { background: #16a34a; color: var(--gj-white); }

/* ─── Formulario [crear_trabajo] ─────────────────────────────────────────── */

.gj-form {
    max-width: 580px;
    margin: 0 auto;
    padding: 32px 0;
    font-family: var(--gj-font);
}

.gj-form__title {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gj-primary);
}

.gj-form__subtitle {
    margin: 0 0 28px;
    font-size: 0.88rem;
    color: var(--gj-text-muted);
}

/* Pasos / fieldsets */
.gj-form__step {
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-radius-lg);
    padding: 20px 24px 24px;
    margin-bottom: 16px;
    background: var(--gj-white);
}

.gj-form__step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 16px;
}

.gj-form__step-num {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gj-secondary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Campos */
.gj-form__field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gj-form__field:last-child { margin-bottom: 0; }

.gj-form__field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

.gj-form__req { color: var(--gj-danger); }

.gj-form__field input[type="text"],
.gj-form__field input[type="date"],
.gj-form__field textarea,
.gj-form__field select {
    padding: 10px 14px;
    border: 1.5px solid var(--gj-border);
    border-radius: 10px;
    font-size: 0.92rem;
    width: 100%;
    box-sizing: border-box;
    background: var(--gj-light);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.gj-form__field input:focus,
.gj-form__field textarea:focus,
.gj-form__field select:focus {
    border-color: var(--gj-secondary);
    background: var(--gj-white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gj-form__field input:invalid:not(:placeholder-shown),
.gj-form__field select:invalid:not([value=""]) {
    border-color: #f87171;
}

.gj-form__field textarea { resize: vertical; min-height: 80px; }

.gj-form__hint {
    font-size: 0.78rem;
    color: var(--gj-text-muted);
}

/* Upload de archivo personalizado */
.gj-form__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.gj-form__file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--gj-radius-lg);
    background: var(--gj-light);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    color: var(--gj-secondary) !important;
}

.gj-form__file-label:hover {
    border-color: var(--gj-secondary);
    background: #eff6ff;
}

.gj-form__file-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    border-radius: 50%;
    color: var(--gj-secondary);
}

.gj-form__file-types {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gj-text-muted);
}

.gj-form__file-name {
    font-size: 0.82rem;
    color: #16a34a;
    font-weight: 600;
    min-height: 1.2em;
}

/* Botón de envío */
.gj-form__actions {
    margin-top: 8px;
    text-align: center;
}

.gj-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gj-secondary);
    color: #fff;
    border: none;
    padding: 14px 36px;
    border-radius: var(--gj-radius-lg);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    width: 100%;
    justify-content: center;
}

.gj-form__submit:hover { background: #0095cc; }
.gj-form__submit:active { transform: scale(0.98); }

.gj-form__legal {
    margin: 12px 0 0;
    font-size: 0.75rem;
    color: var(--gj-text-muted);
}

/* Aviso de éxito */
.gj-form__success {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--gj-radius-lg);
    margin-bottom: 24px;
    color: #166534;
    font-size: 0.9rem;
    line-height: 1.5;
}

.gj-form__success-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gj-success);
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}

.gj-form__success p { margin: 4px 0 0; font-weight: 400; }
.gj-form__success strong { font-size: 0.95rem; }

@media (max-width: 480px) {
    .gj-form { padding: 20px 0; }
    .gj-form__step { padding: 16px; }
    .gj-form__submit { padding: 12px 24px; }
}

/* ─── Mi área [panel_trabajos] ────────────────────────────────────────────── */

.gj-area {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 0;
    font-family: var(--gj-font);
}

/* Header */
.gj-area__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.gj-area__header-left { display: flex; flex-direction: column; gap: 2px; }

.gj-area__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gj-primary);
}

.gj-area__welcome {
    margin: 0;
    font-size: 0.88rem;
    color: var(--gj-text-muted);
}

.gj-area__btn-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gj-secondary);
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.gj-area__btn-new:hover { background: #0095cc; color: #fff; }
.gj-area__btn-new:active { transform: scale(0.97); }
.gj-area__btn-new--sm { font-size: 0.85rem; padding: 8px 18px; }

/* Mini KPIs */
.gj-area__kpis {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.gj-area__kpi {
    flex: 1;
    background: var(--gj-light);
    border: 1px solid var(--gj-border);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.gj-area__kpi-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gj-primary);
    line-height: 1.1;
}

.gj-area__kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gj-text-muted);
    font-weight: 500;
}

.gj-area__kpi--proceso .gj-area__kpi-number { color: var(--gj-secondary); }
.gj-area__kpi--ok .gj-area__kpi-number      { color: #16a34a; }

/* Estado vacío */
/* Feedback de creación */
.gj-area__feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #166534;
    animation: gj-fade-in 0.3s ease;
}

.gj-area__feedback-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gj-success);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Estado vacío */
.gj-area__empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--gj-light);
    border: 2px dashed var(--gj-border);
    border-radius: var(--gj-radius-lg);
    color: var(--gj-text-muted);
}

.gj-area__empty-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.gj-area__empty h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--gj-primary); }
.gj-area__empty p { margin: 0 0 20px; font-size: 0.9rem; }

/* Listado tipo rows */
.gj-area__list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-radius-lg);
    overflow: hidden;
    background: var(--gj-white);
}

.gj-area__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    gap: 12px;
}

.gj-area__item:last-child { border-bottom: none; }
.gj-area__item:hover { background: var(--gj-light); }

.gj-area__item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.gj-area__item-id {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--gj-text-muted);
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gj-area__item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gj-area__item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gj-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gj-area__item-meta {
    font-size: 0.78rem;
    color: var(--gj-text-muted);
}

.gj-area__item-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.gj-area__unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--gj-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
}

.gj-area__arrow {
    font-size: 1.3rem;
    color: #cbd5e1;
    line-height: 1;
}

@media (max-width: 480px) {
    .gj-area { padding: 20px 0; }
    .gj-area__header { flex-direction: column; align-items: flex-start; }
    .gj-area__btn-new { width: 100%; justify-content: center; }
    .gj-area__kpis { flex-direction: row; }
    .gj-area__kpi { padding: 10px 8px; }
    .gj-area__kpi-number { font-size: 1.2rem; }
    .gj-area__item { flex-wrap: wrap; }
    .gj-area__item-right { width: 100%; justify-content: flex-end; margin-top: 4px; }
}

/* ─── Badges de estado ───────────────────────────────────────────────────── */

.gj-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1.3;
}

/* Dot de color antes del texto */
.gj-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Sin asignar — rojo */
.gj-badge--sin_asignar            { background: #fef2f2; color: var(--gj-danger); border: 1px solid #fecaca; }
.gj-badge--sin_asignar::before    { background: var(--gj-danger); }

/* Pendiente — gris */
.gj-badge--pendiente              { background: #f1f5f9; color: #475569; border: 1px solid var(--gj-border); }
.gj-badge--pendiente::before      { background: var(--gj-text-muted); }

/* En proceso — azul */
.gj-badge--en_proceso             { background: #eff6ff; color: #0095cc; border: 1px solid #bfdbfe; }
.gj-badge--en_proceso::before     { background: var(--gj-secondary); }

/* Finalizado — verde */
.gj-badge--finalizado             { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.gj-badge--finalizado::before     { background: var(--gj-success); }

/* Animación del dot para estados activos */
.gj-badge--sin_asignar::before,
.gj-badge--en_proceso::before {
    animation: gj-dot-pulse 2s ease-in-out infinite;
}

@keyframes gj-dot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

.gj-empty { color: #aaa; }

/* Indicador de mensajes no leídos */
.gj-card__footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gj-unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fef2f2;
    color: var(--gj-danger);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #fecaca;
    white-space: nowrap;
    line-height: 1.4;
}

.gj-unread-badge__dot {
    width: 6px;
    height: 6px;
    background: var(--gj-danger);
    border-radius: 50%;
    flex-shrink: 0;
    animation: gj-pulse 1.8s ease-in-out infinite;
}

@keyframes gj-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Burbuja de mensaje no leído — borde lateral + fondo suave */
.gj-chat__bubble--unread.gj-chat__bubble--admin .gj-chat__content {
    border-left: 3px solid var(--gj-secondary);
    background: #eff6ff;
}

.gj-chat__bubble--unread.gj-chat__bubble--cliente .gj-chat__content {
    border-right: 3px solid var(--gj-secondary);
    background: #eff6ff;
}

.gj-chat__bubble--unread .gj-chat__bubble-header::after {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--gj-secondary);
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── Vista de detalle [single-trabajo] ──────────────────────────────────── */

.gj-detail-wrap {
    padding: 32px 0;
    font-family: var(--gj-font);
}

.gj-detail {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Navegación */
.gj-detail__nav { margin-bottom: 0; }

.gj-back-link {
    font-size: 0.85rem;
    color: var(--gj-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.12s;
}

.gj-back-link:hover { color: var(--gj-secondary); }

/* Hero / resumen rápido */
.gj-detail__hero {
    background: var(--gj-white);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-radius-lg);
    padding: 24px;
}

.gj-detail__hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gj-detail__hero-id {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--gj-text-muted);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 6px;
}

.gj-detail__hero-title {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gj-primary);
    line-height: 1.25;
}

.gj-detail__hero-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--gj-text-muted);
}

.gj-detail__hero-sep { color: #cbd5e1; }

/* Bloques de sección */
.gj-detail__block {
    background: var(--gj-white);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-radius-lg);
    overflow: hidden;
}

.gj-detail__block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 24px;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    background: var(--gj-light);
    border-bottom: 1px solid var(--gj-border);
}

.gj-detail__block-icon { font-size: 1.1rem; }

.gj-detail__block-count {
    background: var(--gj-border);
    color: #475569;
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.gj-detail__block--files .gj-detail__block-title {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.gj-detail__block-body {
    padding: 20px 24px;
}

/* Grid de datos */
.gj-detail__grid {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 28px;
}

@media (max-width: 480px) {
    .gj-detail__grid { grid-template-columns: 1fr; }
}

.gj-detail__row { display: flex; flex-direction: column; gap: 3px; }

.gj-detail__row dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gj-text-muted);
    font-weight: 500;
}

.gj-detail__row dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gj-primary);
}

/* Plan de tratamiento */
.gj-detail__plan {
    margin-top: 16px;
    background: var(--gj-light);
    border-left: 3px solid var(--gj-secondary);
    padding: 14px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
}

.gj-detail__plan strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gj-text-muted);
    margin-bottom: 6px;
}

.gj-detail__plan p { margin: 0 0 6px; }
.gj-detail__plan p:last-child { margin-bottom: 0; }

/* Archivo del cliente */
.gj-detail__client-file { margin-top: 16px; }

.gj-detail__file-figure { margin: 0; }

.gj-detail__file-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--gj-border);
    display: block;
    margin-bottom: 8px;
}

.gj-detail__file-doc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gj-light);
    border: 1px solid var(--gj-border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.gj-detail__file-link {
    color: var(--gj-secondary);
    text-decoration: none;
    word-break: break-all;
}

.gj-detail__file-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .gj-detail-wrap { padding: 20px 0; }
    .gj-detail__hero { padding: 18px 16px; }
    .gj-detail__hero-title { font-size: 1.2rem; }
    .gj-detail__block-body { padding: 16px; }
    .gj-detail__block-title { padding: 12px 16px; }
}

/* ─── Lista "Archivos disponibles" ───────────────────────────────────────── */

.gj-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gj-files-list__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: #f6fbf7;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.gj-files-list__thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f5ec;
    border-radius: 4px;
    overflow: hidden;
    font-size: 1.6rem;
    line-height: 1;
}

.gj-files-list__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    display: block;
}

.gj-files-list__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gj-files-list__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a3a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gj-files-list__size {
    font-size: 0.78rem;
    color: #666;
}

@media (max-width: 480px) {
    .gj-files-list__item { flex-wrap: wrap; }
    .galimplant-btn--download { width: 100%; justify-content: center; }
}

/* ─── Chat / Comentarios ─────────────────────────────────────────────────── */

.gj-chat {
    margin-top: 8px;
    background: var(--gj-white);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-radius-lg);
    padding: 0;
    overflow: hidden;
}

/* Cabecera del chat */
.gj-chat .gj-detail__section-title {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 14px 20px;
    background: var(--gj-light);
    border-bottom: 1px solid var(--gj-border);
    border-radius: 0;
}

.gj-chat__count {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gj-text-muted);
    background: var(--gj-border);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
}

/* Zona de mensajes */
.gj-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 20px 16px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--gj-light);
    scroll-behavior: smooth;
}

/* Scrollbar sutil */
.gj-chat__messages::-webkit-scrollbar { width: 5px; }
.gj-chat__messages::-webkit-scrollbar-track { background: transparent; }
.gj-chat__messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.gj-chat__empty {
    text-align: center;
    color: var(--gj-text-muted);
    font-size: 0.88rem;
    padding: 40px 20px;
    margin: 0;
}

/* Burbuja base */
.gj-chat__bubble {
    max-width: 72%;
    padding: 0;
    border-radius: 16px;
    position: relative;
    animation: gj-fade-in 0.2s ease;
}

@keyframes gj-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cliente: derecha — fondo azul */
.gj-chat__bubble--cliente {
    align-self: flex-end;
}

.gj-chat__bubble--cliente .gj-chat__bubble-header {
    background: var(--gj-secondary);
    color: #fff;
    border-radius: 16px 16px 0 0;
}

.gj-chat__bubble--cliente .gj-chat__author { color: #fff; }

.gj-chat__bubble--cliente .gj-chat__content {
    background: #eff6ff;
    color: #1e3a5f;
    border-radius: 0 0 4px 16px;
}

.gj-chat__bubble--cliente .gj-chat__time {
    text-align: right;
    color: #93c5fd;
    background: #eff6ff;
    border-radius: 0 0 4px 16px;
}

/* Admin: izquierda — fondo neutro oscuro */
.gj-chat__bubble--admin {
    align-self: flex-start;
}

.gj-chat__bubble--admin .gj-chat__bubble-header {
    background: var(--gj-primary);
    color: #f1f5f9;
    border-radius: 16px 16px 0 0;
}

.gj-chat__bubble--admin .gj-chat__author { color: #f1f5f9; }

.gj-chat__bubble--admin .gj-chat__content {
    background: #f1f5f9;
    color: var(--gj-primary);
    border-radius: 0 0 16px 4px;
}

.gj-chat__bubble--admin .gj-chat__time {
    text-align: left;
    color: var(--gj-text-muted);
    background: #f1f5f9;
    border-radius: 0 0 16px 4px;
}

/* Cabecera de burbuja */
.gj-chat__bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

.gj-chat__author {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Badge de rol */
.gj-chat__role {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: auto;
}

.gj-chat__role--admin {
    background: rgba(255, 255, 255, 0.15);
    color: #93c5fd;
}

.gj-chat__role--cliente {
    background: rgba(255, 255, 255, 0.2);
    color: #bfdbfe;
}

/* Contenido */
.gj-chat__content {
    font-size: 0.88rem;
    line-height: 1.55;
    padding: 10px 14px 2px;
}

.gj-chat__content p {
    margin: 0 0 6px;
}

.gj-chat__content p:last-child {
    margin-bottom: 0;
}

/* Hora */
.gj-chat__time {
    display: block;
    font-size: 0.65rem;
    padding: 4px 14px 8px;
}

/* ── Formulario de envío ───────────────────────────────────────────── */
.gj-chat__form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 20px 18px;
    background: var(--gj-white);
    border-top: 1px solid var(--gj-border);
}

.gj-chat__form textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gj-border);
    border-radius: 10px;
    font-size: 0.88rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    font-family: inherit;
    background: var(--gj-light);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.gj-chat__form textarea:focus {
    border-color: var(--gj-secondary);
    background: var(--gj-white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gj-chat__form .galimplant-btn {
    white-space: nowrap;
    align-self: flex-end;
    background: var(--gj-secondary);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}

.gj-chat__form .galimplant-btn:hover {
    background: #0095cc;
}

.gj-chat__form .galimplant-btn:active {
    transform: scale(0.97);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .gj-chat__bubble { max-width: 88%; }
    .gj-chat__messages { padding: 14px 12px; }
    .gj-chat__form { padding: 12px; flex-direction: column; }
    .gj-chat__form .galimplant-btn { width: 100%; }
    .gj-chat .gj-detail__section-title { padding: 12px 14px; }
}
